Unknown Prop Warning
function MyDiv(props) {
if (props.layout === "horizontal") {
// BAD! Because you know for sure "layout" is not a prop that <div> understands.
return <div {...props} style={getHorizontalStyle()} />;
} else {
// BAD! Because you know for sure "layout" is not a prop that <div> understands.
return <div {...props} style={getVerticalStyle()} />;
}
}Last updated