I have a state property in _app.js that I want to update when a property changes in App.tsx. It's related to updating theming to darkmode.
Is there a way to notify _app.js when a property changes in App.tsx?
Below is an example of _app.js where changes to the context property is being monitored. However this doesn't work probably because the context check is outside the provider whichi is returned by _app.js
function MyApp({ Component, someProps }) {
const myContext = useContext(MyContext);
React.useEffect(() => {
alert('helloworld');
}, myContext.darkMode);
return (<MyContext.Provider value={someProps}>
<Component {...pageProps} />
</MyContext.Provider>);
export default MyApp;