-
-
Notifications
You must be signed in to change notification settings - Fork 970
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
Error updating component with static template #3003
Comments
Thank you, would you mind adding a test and patching this method? |
I'll do asap. Just a couple questions to understand better the scenario and craft accurate test cases:
|
You can play a bit here -> https://riot.js.org/online-compiler/ <my-tag>
<h1>{props.title}</h1>
<p>{props.message}</p>
<small>hey there</small>
</my-tag> The above template has 2 Text bindings set on the
Since the bindings are detected from the root node, the first either belongs to the root node or to the first tag of the component. I think that the method might be slightly improved, because now also nested bindings might filter out props on the root node. I will patch it asap but I hope that this explanation clarifies a bit how Riot.js works internally |
I see you committed a solution. I was about to edit the code but it seems that there’s no need anymore. Thank you for the explanation! Very helpful. |
Help us to manage our issues by answering the following:
As the title says I encountered an error when a component of mine, that has a static template because it then manipulate autonomously the dom, is updated.
At the mounting stage it runs properly, but when it is updated it throws the following error:
This is the affected line:
template?.bindingsData?.[0].expressions?.reduce(
and I think that it could be simply edited like:
template?.bindingsData?.[0]?.expressions?.reduce(
Yes: here
initially everything is ok, but when the button "update" is pressed, it throws the aforementioned error.
I think everyone, but I encountered it on Firefox on Windows 10
9.1.5
The text was updated successfully, but these errors were encountered: