erasmo-marin / suitup-ui-legacy

Web ui toolkit made with and for React.js - demo/docs (in development) https://suitup-ui.org/
7 stars 2 forks source link

Find header fails when component its not defined #16

Closed cstamariab closed 6 years ago

cstamariab commented 6 years ago

Sometimes when change te state of some components this error happends.

Uncaught TypeError: Cannot read property 'type' of null
    at eval (index.js?2751:150)
    at forEachSingleChild (ReactChildren.js?2d30:49)
    at traverseAllChildrenImpl (traverseAllChildren.js?32bc:75)
    at traverseAllChildrenImpl (traverseAllChildren.js?32bc:91)
    at traverseAllChildren (traverseAllChildren.js?32bc:170)
    at Object.forEachChildren [as forEach] (ReactChildren.js?2d30:69)
    at Layout.findHeader (index.js?2751:149)
    at eval (index.js?2751:156)
    at forEachSingleChild (ReactChildren.js?2d30:49)
    at traverseAllChildrenImpl (traverseAllChildren.js?32bc:75)

The error line:

if (x.type && (x.type.displayName == "Header" || x.type.displayName == "Component(Header)")) {

erasmo-marin commented 6 years ago

Thank you very much Chris