Skip to content

Are createMemo and createEffect necessary in this port of React's use-gesture? #572

Answered by ryansolid
imedadel asked this question in Q&A
Discussion options

You must be logged in to vote

Yep because Solid only runs once, if there is nothing that requires reactive tracking and updates the createMemo is unnecessary. The empty dependency list in React is why I feel extra confident of this, since it indicates it never updates. At that point you may only need onMount to wait until after render and onCleanup to well, cleanup. I'm not even sure onMount is absolutely necessary, but maybe it's better to wait to do that part of the setup until after render.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by imedadel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants