Navigation Menu

Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

The tabs do not rerender on state change #28

Closed
jmarucha opened this issue Jul 24, 2018 · 2 comments
Closed

The tabs do not rerender on state change #28

jmarucha opened this issue Jul 24, 2018 · 2 comments

Comments

@jmarucha
Copy link

The tab list only changes on first rendering of the UI. The changs of state don't cause proper rendering.

I would expect following (pseudo)code to result in one of tabs showing if and onli if this.state.isAdmin is true, however it only depends on the initial value of this state field (the isAdmin is loaded asynchronously).

<Admin ...>
    <Resource ... />
    {this.state.isAdmin ? <Resource ...> : null}
</Admin>

The title prop of component however rerenders correctly, and also console.logs display proper, updated state.

  • Admin-on-rest version: 1.4.1
  • React version: 16.2.0
  • Browser: Firefox 61.0.1 (64-bit)
@fzaninotto
Copy link
Member

fzaninotto commented Jul 24, 2018

You mean menus, right?

@djhi
Copy link
Contributor

djhi commented Jul 24, 2018

For those cases, use the recipe explained here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants