Chalarangelo / furl

Functional react.js components.
https://furl.netlify.com/
MIT License
34 stars 2 forks source link

item.type is undefined #33

Closed Chalarangelo closed 5 years ago

Chalarangelo commented 5 years ago

It seems like some components that filter their children might end up getting item.type equal to undefined.

I have seen this happen when a component that applies a filter contains children separated by a space on the same line.

Possible solution

Replace all instances of item.type.name === ComponentX.name with a more robust check which checks item.type && item.type.name && item.type.name === ComponentX.name instead. This will safeguard against this particular problem and possibly others in the future.