When we spread props we run into the risk of adding unknown HTML attributes, which is a bad practice. Instead we can use prop destructuring with
operator, so it will add only required props....rest
For example,
const ComponentA = () => (<ComponentB isDisplay={true} className={"componentStyle"} />);const ComponentB = ({ isDisplay, ...domProps }) => (<div {...domProps}>{"ComponentB"}</div>);