For loop in route breaks when form in another component is submitted
I have this <For> loop in a route. Works fine....
UNTIL.....
There is another component I can use from the route that displays some search results. As soon as I submit the form in the search component I get this error message: note is undefined
I'm stuggling to understand why an element of the array I'm looping through suddenly becomes undefined when I submit a form in another component.
The array I'm looping through always appears to have five items in it. I'm console.logging notes() with a createEffect and it always has five items.
8 Replies
Also, as soon as I click "clear errors and retry" it's fine again
notes() is changing from this to this
I guess this is wrong:
And this is right:
Not sure what the difference is
but the second one works all the time
how is
reader
signal setup?by the way, use ` for better code readability
It seems like I need to add "js" after the first set of backticks when I do that or I don't get syntax highlighting
yup