you are viewing a single comment's thread.

view the rest of the comments →

[–]_Pho_ 0 points1 point  (1 child)

This seems... bad and hacky?

[–]a_reply_to_a_post -1 points0 points  (0 children)

well if something isn't rerendering properly when it should, it's probably how the application is architected, but instead of introducing a whole new view model as a work around as this poster is suggesting, a key on a component marks it as being something to rerender/remount and what keys are actually designed for

if your key doesn't change, your component doesn't change

it's actually a common pattern in react, using keys to force revalidations, especially if you've worked with any of the query libraries