You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
I have a React component with a number of tabs, each dependent on different Parse queries. I have made observe() dependent on the currently selected tab, which is stored in the component's state. When observe is called, it is done with the state before the setState() call that sets off the process. However, render is called with the state after setState(), which misaligns the the component's data with the data needed by the tab.
I believe this is because React does not update state until just before rendering (facebook/react#629).
the observe method takes nextProps and nextState as arguments. That's because we fire it from componentWillUpdate, which is called before state is updated, as you noted.
If you want the previous state, it'll be at this.state. If you want the new state, use the second argument of observe.
I have a React component with a number of tabs, each dependent on different Parse queries. I have made observe() dependent on the currently selected tab, which is stored in the component's state. When observe is called, it is done with the state before the setState() call that sets off the process. However, render is called with the state after setState(), which misaligns the the component's data with the data needed by the tab.
I believe this is because React does not update state until just before rendering (facebook/react#629).
Will this be fixed with #1?
The text was updated successfully, but these errors were encountered: