6 Matching Annotations
- Oct 2020
-
github.com github.com
-
-
Svelte right now has a lot of opportunities to have component state become out of sync with props.
-
I'm suggesting this is a problem generally. Users will not think of being out of sync with props
-
Svelte doesn't re-render, so you need to respond to component mount/dismount and prop changes separately as they are distinct concepts and never tied together, unlike in React.
Tags
- issues I'm watching
- a problem worth solving properly
- UI library: reacting to prop changes
- easy to forget
- trying to doing things the same way you did in a different library/framework (learning new way of thinking about something / overcoming habits/patterns/paradigms you are accustomed to)
- lifecycle callbacks
- easy to get wrong
- useEffect
- different way of thinking about something
- distinction
- I have this problem
- Svelte
- general problem
Annotators
URL
-
-
dylanvann.com dylanvann.com
-
To fix our Svelte version you might think we could use beforeUpdate or afterUpdate, but these lifecycle functions are related to the DOM being updated, not to prop updates. We only want to rerun our fetching when the album prop is changed.
-
Beautiful, except that switching albums does not update the PhotoGrid. This is not the automatic reactivity we were promised by Svelte.
-