A valid React (or null) element must be returned. You may have returned undefined, an array, or some other invalid object.
, ... , , ...
, ( "foo" ) . ?
function H1({ importance, children }) {
return importance === 'HIGH'
? (<High>{children}</High>)
: (<Default>{children}</Default>);
}
Update
, Object Spread Operator :
function H1(props) {
return importance === 'HIGH'
? (<High {...props} />)
: (<Default {...props} />)
;
}