-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Literals in props should not be updated #1394
Comments
To clarify: function create_main_fragment(component, ctx) {
var list_initial_data = { items: [1, 2, 3] };
var list = new List({
root: component.root,
data: list_initial_data
});
return {
c: function create() {
list._fragment.c();
},
m: function mount(target, anchor) {
list._mount(target, anchor);
},
+ p: noop,
- p: function update(changed, ctx) {
- var list_changes = {};
- list_changes.items = [1, 2, 3];
- list._set(list_changes);
- },
u: function unmount() {
list._unmount();
},
d: function destroy() {
list.destroy(false);
}
};
} |
Rich-Harris
added a commit
that referenced
this issue
May 2, 2018
Rich-Harris
added a commit
that referenced
this issue
May 3, 2018
only update component props if they are dynamic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a case like this...
...
items
should never be updated, even if<List>
had other properties that were being updated.The text was updated successfully, but these errors were encountered: