RaspberryPiFoundation / editor-ui

Code Editor web component
https://editor-static.raspberrypi.org
Apache License 2.0
36 stars 9 forks source link

Fix web-component context #1035

Closed sra405 closed 3 months ago

sra405 commented 3 months ago

Currently the web component doesn't have access to the browser context. This typically isn't an issue until we utilise components like Link which soft reloads pages and keeps state with a useContext hook.

https://github.com/RaspberryPiFoundation/editor-ui/assets/74183390/40ee68a3-287c-4c01-820b-1b90cc06bbcb

Fix

I wasn't expecting wrapping the web component in a BrowserRouter to work but it does and means this issue is relatively trivial. I do suspect this comes with caveats and its worth being mindful there may be differences in the implementation in a web component we're not expecting

github-actions[bot] commented 3 months ago