SolidJSS
SolidJSโ€ข3y agoโ€ข
3 replies
FjordWarden

Remove element from store not working

I'm trying to remove an element from a reactive store based on the index. I've tried versions of this but I keep getting an error telling me "Cannot mutate a Store directly":

props.setMyFilter(i(),reconcile(props.myFilters.splice(i(),1)))
props.setMyFilter(reconcile(props.myFilters.splice(i(),1)))


I've tried both <For> and <Index>

I've also tried something like props.setMyFilter(i(),undefined) but this does not result in any change in the DOM, but it does log an error because it is trying to render a element from the store that is no longer there.

Uncaught TypeError: Cannot read properties of undefined (reading 'description')
Was this page helpful?