SolidJSS
SolidJSโ€ข3y agoโ€ข
4 replies
goenning

how to use useParams inside a ContextProvider

I have something like this
return (
    <Router>
      <MyContextProvider>
        <Routes>
          <Route path="/" ...
          <Route path="/posts/:slug" ...


and I want to access the slug on MyContextProvider on inital page load.

useParams seems to always return an empty object ๐Ÿ˜ฆ
Was this page helpful?