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
- 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)
- issues I'm watching
- lifecycle callbacks
- general problem
- distinction
- Svelte
- useEffect
- I have this problem
- easy to forget
- UI library: reacting to prop changes
- different way of thinking about something
- a problem worth solving properly
- easy to get wrong
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.
-