#[SOLVED] Force reload a script

5 messages · Page 1 of 1 (latest)

vague compass
#

Hello, anyone has any advice how I can trigger a script reload?

I have an element in a React TSX file that changes dynamically depending on screensize. My script (public/theme.js) can detect the element on first load, but when I resize my screen and the dynamically generated element appears, it is not detected by the script. So, I need to force reload the script everytime my screen size change.

analog sun
#

Sounds like adding an event listener inside your script to listen for window resizes would be the best option

hasty hare
#

Are you using <ViewTransitions />?

vague compass
vague compass