#467·flux

New Flux store instance created upon second component referencing store

Author: bluebeagCreated Feb 14, 2019Updated Feb 15, 2019

I have one Flux store that is imported by two components. One a security based component and the other an app business data view. That Login.js component successfully logs in using Okta, obtains user info. from the application and stores it in the Flux store. The user navigates to the app data page, the dataview.js, which imports the store, uses it to retrieve user info before making fetch calls. The problem is the user state in the store is now undefined since the store has been newly constructed. It seems since the user info has not changed it should not be removed. The app data is still null since it hasn't retrieved the info yet. The store should behave like a singleton and ONLY update state when an action has been dispatched.