react spread attributes conditionally

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

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} >