Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react Spread Attributes conditionally

const DriverSelector = props => {
  const Container = props.container;
  const otherProps = {
    ...( props.containerStyles && { style: props.containerStyles } )
  };

  return (
    <Container {...otherProps} >
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #Spread #Attributes #conditionally
ADD COMMENT
Topic
Name
7+1 =