Open blabute opened 2 years ago
@TheSpicyMeatball curious your thoughts on this when you get a chance!
Getting the same error:
TypeError: Cannot read properties of undefined (reading 'props')
when one of the child nodes is undefined.
Found a temporary fix/workaround - wrap the node which contains a possible undefined value in a fragment component. For example:
<>{value && <p>{value}</p>}</>
Found a temporary fix/workaround - wrap the node which contains a possible undefined value in a fragment component. For example:
<>{value && <p>{value}</p>}</>
Thanks for the suggestion! It definitely works but since the offending code is valid jsx, I think the repo should be updated to handle it.
@alleksei37, I shared this message on the initial issue in case you are looking for alternatives.
This corrects null reference error when a child is null/undefined (which is valid).
Closes 18.