Rerendering a React component in response to outside change without state management or resorting to context provider
You don't alway need a state management library or resorting to convoluted solutions to pickup changes outside your component. Here is an example of using React's useState
and useEffect
hooks to rerender a component when something outside of it changes and not even in a parent component.