Closed 11111000000 closed 8 years ago
Decomposition:
...
return (<TextField content={something} />)
...
where
const TextField = ({props : {content = ''}}) =>
(<div class='text-field'>{ content }</div>)
You can also use a null
value. That will be transformed into a noscript
tag during the diff.
let something = null
// Some logic...
return (
<div>{ something }</div>
)
What is a common way to handle undefined content inside tags:
which thrown errror if
something
isundefined
.Now we code like this:
but too many hard to maintain conditionals is a pain!
I miss something, or how to implement:
...or maybe there is a other, better way to do that and other validations? (may be with redux?)