Closed LuisaAPF closed 2 months ago
Apologies, the docs PR detailing this change ~has not yet merged~ was only just merged today.
You now simply pass props to rerender
directly. You should be seeing a warning log to this effect.
- await rerender({props: {show: false}})
+ await rerender({show: false})
Thanks for your reply @mcous. I think I figured out the reason the tests broke. It wasn't because of the syntax (by the way, I didn't see any warnings, not sure if Vitest is suppressing them). It was because I was not using a reactive variable to hide my component, but instead a regular variable that depends on the prop and which was being assigned on mount.
Gotcha; that makes sense! rerender
in v4 destroyed and remounted the component, which would prevent you from seeing those sorts of reactivity bugs. That's why it was changed!
Tests that use
rerender
started failing after upgrading from 4.1.0 to 5.1.0. I understand the function behaviour changed recently, but this is not working for me: