Open raykyri opened 3 years ago
@raykyri not sure why you'd get an error thrown in a view, but maybe you could post some simplified code (ideally in a flems, possibly reproducing the error)?
Hi All!
I believe I have an example. It is quite non-sensical, but we had something similar in real code:
If you change the option in the select a few times, you'll see that new items in the list are being added and the old ones are not removed. The stack trace is not helpful, because it happens inside mithril and not in the user's code.
Thank you!
It seems to me that the issue is that key
is missing in the li
items.
This is somewhat a duplicate of #2273, but I also haven't seen it mentioned in the thread or anywhere else (or maybe I missed it):
When an error is thrown in a view in Mithril, the diffing engine will often get confused and start rendering multiple copies of the same component to the page.
This seems unexpected, and I haven't seen it mentioned anywhere else. Am I doing something wrong?