JonathanExcelsior
createSignal vs createStore
When should createSignal be used instead of createStore and vice versa?
If I want to store an object in state, for example:
Which is preferable, createSignal or createStore? Is there any performance benefits in using one over the other? Should createSignal only be used for primitive data types and createStore for complex data types? Should createStore only be used if you want nested reactivity?
I'm just trying to understand when best to use each.
6 replies
Signals in global scope vs component scope.
Is there a preferred way or best practice in handling state for components? Should we try to keep components pure?
In one of my applications, I have signals declared outside of components, making them global. Is there an disadvantage to doing this or should I aim to pass the signals as props?
https://www.solidjs.com/tutorial/stores_nocontext
3 replies
Can you use the reactive object from useSearchParams as a source signal for createResource?
I've used the property of the reactive object returned from useSearchParams as a source signal for createResource, however, it's currently not working. It does not trigger the fetcher function. However, the property of the searchParams object is updated and I see this reflected in the UI.
5 replies
Rendering issue
When trying to render the same JSX stored in state to the screen twice at the same time. It only renders one of the JSX elements.
The JSX is passed as props to the component and is stored in an accessor function returned from the createReducer primitive. I am doing something wrong?
10 replies
Is there a preference as when to use props or import data types?
With SolidJS you can export/import createSignal's getter and setter functions between files. How does this compare to passing the getter and setter as props?
Thanks
2 replies