Hi all,
Not a question, but perhaps some useful info that can help some out.
I created an extension using React and was using the BrowserRouter from react-router-dom
My import was the following:
import { HashRouter as Router, Route, Routes } from "react-router-dom";
and my “routing” code:
<Router>
<Routes>
<Route path="/panel" element={<ParentContainer />} />
<Route path="/config" element={<ConfigPage />} />
</Routes>
</Router>
On the Asset Hosting tab of the twitch dev console i had configured:
- Panel viewer path: panel
- Config Path: config
I tried a whole lot of stuff, but could not get this to work for me. It worked fine when on local test, but not in hosted test.
After a lot of trial and error, I had to change the routing to get it to work. The most simple solution for me was:
Change your import to :
import { HashRouter as Router, Route, Routes } from "react-router-dom";
*Note, now using HashRouter instead of BrowserRouter
On the Asset Hosting tab of the twitch dev console change to :
- Panel viewer path: #/panel
- Config Path: #/config
The extension then worked in both localtest and hosted test! (at least for me, i hope for you as well)
I hope it is okay to create a topic for this, even though it’s not a question but more a FIY