You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very common pattern is the && checks for JSX syntax.
When using this yntax the JSX element can be "null". This unfortunately also requires the component to check for null´s when iterating through the children.
Note:
This is only true for when using the setActiveFromChild prop.
What should be happening?
It should not throw an error complaining about "null"
Uncaught TypeError: Cannot read property 'props' of null
at reactstrap.es.js:944
at mapSingleChildIntoContext (react.development.js:880)
at traverseAllChildrenImpl (react.development.js:753)
at traverseAllChildrenImpl (react.development.js:769)
at traverseAllChildren (react.development.js:824)
at mapIntoWithKeyPrefixInternal (react.development.js:900)
at Object.mapChildren [as map] (react.development.js:922)
at ProxyComponent.render (reactstrap.es.js:943)
at ProxyComponent.hotComponentRender (react-hot-loader.development.js:620)
at ProxyComponent.proxiedRender (react-hot-loader.development.js:635)
Code
React.Children.map(this.props.children[1].props.children, function (dropdownItem) {
if (dropdownItem.props.active) subItemIsActive = true;
});
The text was updated successfully, but these errors were encountered:
Psvensso
pushed a commit
to Psvensso/reactstrap
that referenced
this issue
Nov 13, 2018
#6.5.0
cjs
#16.5.1
What is happening?
A very common pattern is the && checks for JSX syntax.
When using this yntax the JSX element can be "null". This unfortunately also requires the component to check for null´s when iterating through the children.
Note:
This is only true for when using the setActiveFromChild prop.
What should be happening?
It should not throw an error complaining about "null"
Steps to reproduce issue
From example but with a dummy && check.
Error message in console
Code
The text was updated successfully, but these errors were encountered: