snorbi
Solving "computations created outside ..." using `createMemo() ?`
I got the following warning because I used
props.values
in my event handling code:
computations created outside a createRoot or render will never be disposedI have read the docs and some additional info (like https://github.com/solidjs/solid/issues/2130). The warning is gone when I simply wrap the
props.values
access in a createMemo()
:
My question is: is it a good solution?
If yes, then why the props
accessors are not functions themselves (like props.values()
instead of the current props.values
) so they would always return a "fresh" value?
Thanks.8 replies
Passing Component in props
I try to generalize the following fragment:
where my component would apply the same ID for the
<label>
and the <input>
but also the <input>
would come as a parameter in props.
Something like this - except that it does not work 😄
And call it like:
Thanks.5 replies
Handling <input>
Is this a correct way to handle <input> fields?
<input onInput={e => setUserName(e.target.value)} value={userName()} />
Or should I use a ref instead and read the field value when it is needed?
Is there a concept of "controlled input" in solidjs?
Or only "uncontrolled input"?
Thanks.6 replies
Is this a correct implementation? :)
I'm new to both JSX and Solid.
Is this a correct implementation or can it be simplified?
The goal is to render a
<a>
with a customized href
prop, rendering the children
, while passing all other props unmodified.
Thanks.3 replies
Reactive array transformation
What is the correct way to make the result of a filtering+mapping operation on an array reactive?
What should I write instead of the object literal?
What I would like to do is to refactor some code to separate functions but the result to remain "reactive".
Thanks.
6 replies