You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're integrating a legacy HTML wireframe system into React Router v7 where we inject complete HTML structures (headers, footers, navigation) with embedded JavaScript into our React components. The wireframe isn't just JavaScript - it's entire HTML sections with associated scripts that get injected via dangerouslySetInnerHTML.
The issue: Every time a nested loader/action executes, React Router re-renders our layout component, which causes:
Complete re-injection of wireframe HTML sections (header, footer, navigation)
Re-execution of embedded wireframe JavaScript
Duplicate event listeners on wireframe elements
Repeated API calls from wireframe scripts (cart updates, user status checks)
Loss of wireframe state (open menus, form inputs, etc.)
Questions for the Community
Should wireframe HTML injection happen outside the route component tree entirely, or is there a React Router-specific approach?
How do we maintain wireframe DOM state across route navigations without full re-injection?
This is essentially about preserving injected legacy HTML/JS wireframe context while allowing React Router to handle the inner application routing.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
We're integrating a legacy HTML wireframe system into React Router v7 where we inject complete HTML structures (headers, footers, navigation) with embedded JavaScript into our React components. The wireframe isn't just JavaScript - it's entire HTML sections with associated scripts that get injected via dangerouslySetInnerHTML.
The issue: Every time a nested loader/action executes, React Router re-renders our layout component, which causes:
Questions for the Community
This is essentially about preserving injected legacy HTML/JS wireframe context while allowing React Router to handle the inner application routing.
Thanks In advance!
Beta Was this translation helpful? Give feedback.
All reactions