reactjs - Does react have a "null element"? -


i have piece of component looks this

            c.props.results.totalcount > c.props.searchoptions.perpage                  ? createelement(reactpaginate, {                     previouslabel: "<",                     nextlabel: ">",                     pagenum: math.ceil(c.props.results.totalcount / c.props.searchoptions.perpage),                     marginpagesdisplayed: 2,                     pageranedisplayed: 5,                     containerclassname: "pagination",                     activeclass: "active",                     forceselected: c.props.searchoptions.page,                     clickcallback: noop                 })                 : null 

basically, if there page, include pager widget, otherwise don't.

i'd encapsulate logic in own component.

createelement(optionalpager, c.props) 

the problem render function can't return null , i'd prefer not insert intermediate element here. there sort of react.dom.null element can return instead?

the render function class should able accept null.

https://facebook.github.io/react/blog/2014/07/17/react-v0.11.html

if calling react.render though can render noscript do

react.render(<noscript />, ...) 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -