I have component like this:
import React, { useEffect } from 'react';
const WindowFocusHandler = ({store}) => {
// here store object is valid and work
useEffect(() => {
window.addEventListener('focus', () => {
console.log('Tab is in focus... but no store object here', store);
});
});
return <></>;
};
export default WindowFocusHandler;
And I am trying to pass store object inside listener function but failed what ever I try.