You should look into a state management library like Redux. With Redux you'll have a global state store that all of your components can pull from.