I need to customize the style of my React.js app based on which client is using it, and I'm trying to pass the client id in the url. The url looks like this:
/#/app/client/dashboard
I created the Rout using this param:
<Route path="/app/:client/dashboard" component={Dashboard} />
Great. Now I want to retrieve the param in my root component. I tried two things. The first is to see if it's in the props object:
export default function App(props)
but it's not there.
Then I tried to set the localStorage with a client item in the Dashboard component, but that's too late because the App() function is called before the Dashboard() function.
Is there any other way to do this?
matchin props of Dashboard component?__proto__and there's nomatchin it.Route. Where isAppcomponent in relation toDashboard?