Re-initialize component after page transition #817
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Which version did you upgrade from, and which version did you upgrade to? If upgrading from swup 3 to 4, the official upgrade guide might give a clue here, in case it has to do with updated hook names. In any case, it'd be helpful if you could post your whole JS code here, including the part that manages the dark mode toggle. Any console errors? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Here is a picture of the Astro.config.mjs. |
Beta Was this translation helpful? Give feedback.
It's worked out. I thought I also have to swup.hooks.before("content:replace", () => {} ); maintain it so that it takes effect. Oh man. Difficult birth. With Init at swup.hooks.on is also correct because if I leave out init the dark mode doesn't work. I thank you from the bottom of my heart for your help and your patience, my good friend. Now I can go to sleep with peace of mind. I wish you a good night too.
Bildschirmaufnahme.2023-11-13.um.00.46.34.mov