I have this code, please see the title
prop:
const App = () => (
<Admin
theme={theme}
customRoutes={customRoutes}
menu={Menu}
dataProvider={loopbackRestClient(window.apiUrl)}
authProvider={authClient()}
dashboard={Dashboard}
locale="en"
i18nProvider={i18nProvider}
title={`Dashboard - ${window.accountData ? window.accountData.accommodation.name : ''}`}
>
// more code here...
This tries to change the rendered title
when login succeeds and therefore we get different accommodation.name
value from there.
I was expecting that the component may re-render with this event, since login affects the REDUX state, so the window
variable (which changed after login) should render a different title.
It did not work.
How may we do it the proper way (react-redux way)?