Prevent re-render <table> element when changing array in store.
is it possible to prevent re-render whole table element when i splice element from array in store? Table has a hundreds of rows where each row is an array item in store. when delete some items from array will re-render whole table. And it takes some time. I need just delete some <tr> element from DOM. Thanks!
3 Replies
How are you mutating the store? Perhaps you are mutating in a way that "blows away" the entire array, rather than just setting the specific item. If you're using splice, I'm almost sure you're blowing out the array unless you're using produce
You can delete a specific item (at index 5, for example) from the store using
setStore("arrayInStore", 5, undefined)
Thanks! I tried that setStore("arrayInStore", 5, "undefined"). It still rerun <For> element where i use store and render whole table again.
Then there's probably a problem somewhere else. It's impossible to say more without seeing the code 🤷. A playground is usually best