work, webdev
soI have a (legacy) React application in which a page returns a completely different tree depending on if it's mobile or desktop (using the page width to determine that)
we need to add a component in there which holds some internal state, which can be changed by user interaction. the issue we're facing is that, if the user resizes the page, causing it to switch between the desktop and the mobile tree, the component re-mounts, and thus it resets to its initial state
anyone has any idea on how to avoid that?