从子屏幕 Reach Navigation Hooks 使用 Goback 函数时如何刷新父屏幕并获取旧状态值?

How to refresh the parent screen and get old state values when using Goback function from child screen Reach Navigation Hooks?

我正在使用挂钩并设置状态值。我有 2 个屏幕。当我使用 goback() 从屏幕 2 返回到屏幕 1 时,我需要获取硬编码的旧状态值。

结帐React navigation events

   React.useEffect(() => {
      const unsubscribe = navigation.addListener('focus', () => {
        // do something
      });

      return unsubscribe;
    }, [navigation]);