message: removed setTimeOut function in useEffect and moved addEventListener function to beginning
diff: @@ -57,20 +57,18 @@ export default function RecoilizeDebugger(props) {
  // React lifecycle hook on re-render
  useEffect(() => {
  + // Window listener for messages from dev tool UI & background.js
  + window.addEventListener('message', onMessageReceived);
  +
  if (!isRestoredState) {
  - setTimeout(() => {
  const devToolData = createDevToolDataObject(filteredSnapshot);
  // Post message to content script on every re-render of the developers application only if content script has started
  sendWindowMessage('recordSnapshot', devToolData);
  - });
  } else {
  isRestoredState = false;
  }
  - // Window listener for messages from dev tool UI & background.js
  - window.addEventListener('message', onMessageReceived);
  -
  // Clears the window event listener.
  return () => window.removeEventListener('message', onMessageReceived);
  });
  