react spread attributes conditionally

Solutions on MaxInterview for react spread attributes conditionally by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "react spread attributes conditionally"
Filippo
04 Jan 2018
1const DriverSelector = props => {
2  const Container = props.container;
3  const otherProps = {
4    ...( props.containerStyles && { style: props.containerStyles } )
5  };
6
7  return (
8    <Container {...otherProps} >