mardi 17 février 2015

How to get ReactJS to render empty HTML attributes


I'm trying to get React to render an empty attribute, but instead it's not including it at all. Any ideas?



render(){
return <myComponent foo="{ this.state.foo }" />
}


when this.state.foo if falsey, this yields:



<mycomponent />


whereas I want:



<myComponent foo />




Aucun commentaire:

Enregistrer un commentaire