CreateEffect has infinite loop
So I am having an infinite loop issue with an effect that I am trying to figure out how to handle without having to resort to
createReaction()
since I find those are less than ideal to work with but maybe that is the only SingleInFormAutoShowOptions.
I have this code:
Now the problem with this is the setValue()
internally sets whether or not the fieldName
has been "touched" and to do that, I need to get the existing touched fields to add the new one to and since that gets the touched fields, that causes the effect to run over and over again.
Is there a better way to handle this?2 Replies
If you need access to the current touched fields, you can access the current values in the setter
optionally, use
untrack
https://www.solidjs.com/docs/latest/api#untracktotally forgot about that (which is funny since I am using that method everywhere else), Thanks.