Skip to content
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

Prop mutation #64

Open
johnpuddephatt opened this issue Aug 30, 2022 · 0 comments
Open

Prop mutation #64

johnpuddephatt opened this issue Aug 30, 2022 · 0 comments

Comments

@johnpuddephatt
Copy link

Currently blocks are mutating props directly, e.g:

@blur="props.block.details.value=content?.innerText"

My understanding is that props are readonly and shouldn't be mutated, instead an event should be emitted back up to the parent, which should then reassign the new value at the top level (which then cascades back down to the component). This is Evan You's advice and it came up on Twitter in response to the announcement.

I'm happy to submit a PR showing this in practice if it's helpful but wanted to first ask in case there was something I'm missing.

(amazing work by the way, I'm really excited about Lotion's potential!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant