Pass And Amend Element Props With A React Function
This is with a spread and destructuring
functionBox({className, ...rest}){return<divclassName={`box ${className}`} {...rest} />
}
const element = (
<Box className="blue" style={{fontStyle: 'italic'}}>
This is the box
</Box>
)
results in:
<divclass="box blue"style="italic">
This is the box
</div>