I have a scenario in which I want to dynamically assign an attribute to my PrivateRoute component.
This is my component.
<PrivateRoute exact path="/" component={HomePage} />
Here I want something like this:
<PrivateRoute {localStorage.getItem('user') ? exact : '' } path="/" component={HomePage} />
If the localStorage.getItem('user') is true then only exact should be applied.