3 ms·
Quite interesting. For a moment I've thought it is another JS issue but no. It's React who's strange https://github.com/facebook/react/blob/v0.11.2/src/browser/
by sergeykish 9y ago
Quite interesting. For a moment I've thought it is another JS issue but no. It's React who's strange https://github.com/facebook/react/blob/v0.11.2/src/browser/ui/ReactDOMComponent.js#L184 https://github.com/facebook/react/blob/v0.11.2/src/browser/u... https://github.com/facebook/react/blob/v0.11.2/src/utils/traverseAllChildren.js#L126 https://github.com/facebook/react/blob/v0.11.2/src/utils/tra...
Same behavior on Ruby:
def content_markup(children)
case children
when String, Numeric
children
when NilClass, TrueClass, FalseClass
return
else
# ...
end
end
content_markup 'foo'
#=> "foo"
content_markup 0
#=> 0
content_markup true
#=> nil
content_markup false
#=> nil
content_markup nil
#=> nil