-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'parent' when number of Trails decreases and then increases #738
Comments
The sandbox you linked in #642 (comment) was incorrect. You forgot to use |
Hi @aleclarson, As a side note: |
The updated sandbox is using v8. Can you try with v9? It looks fixed there, but if you type fast, it looks like there are other issues. Btw, thanks for the useful sandbox, I'll probably add it to react-spring-examples when I get time. |
I went to do some more testing in v9 and here is what I've found so far. First links to playgrounds:
Hope this helps to narrow down source of problems :D |
@aleclarson is there any workaround, for now, to handle this scenario? |
Both seem to be fixed in v9.0.0-rc.2 #985
That's how the |
🐛 Bug Report
Edit: See this comment for the v9 errors.
It took some time to nail it to a repeatable state. I saw some reports on this already but those didn't have conclusion yet.
So, when you use Trail render props and your list is dynamically changing you might face the
Uncaught TypeError: Cannot read property 'parent' of undefined
on certain occasions.
I narrowed down one reproduce-able scenario to when amount of your list items decreases and then increases.
To Reproduce
Expected behavior
I would expect Trail to work regardless of the number of items in the items list.
Link to repro (highly encouraged)
Example of implementation:
https://codesandbox.io/s/trail-issue-h5dcc
In the example I use Trail to display hints. Number of Trail items (hints) depends on the length of typed input. For 1 char, there are 3 hints, for 2 chars there are 6 hints, for 3 chars there are 2 hints, for 4 chars there is 1 hint, for 5 chars there are 4 hints.
If you type 5 chars the condition for the bug will be satisfied and the error will occur.
Environment
react-spring
v8.0.27react
v16.8.6Other context
I tried react spring 9 beta 3.0 but I can't get the Trail working there at all. I've reported the issue in beta discussion thread. (#642 (comment))
The text was updated successfully, but these errors were encountered: