-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Description
Hey there, looks like currently Tree.tsx
assumes that treeWalker will always yield valid node data and that it will never be undefined, even though that is a valid return value for yield
expressions (there is even a non-null assertion on the yielded value).
I'd like to propose that this behaviour be changed so that undefined values are handled gracefully as it would allow returning early in the case of not having nodes to render yet, etc, whereas right now an Cannot read property 'data' of undefined
error is thrown.
@Lodin I'd be happy to PR a fix here but I'm not quite sure what the desired behaviour would be in this case, should I just return early with null
inside of generateNewTree
?
Anyways, thanks for an otherwise awesome library!
barbalex