【问题标题】:Caught Error error while using useEffect react native HOOks使用 useEffect 反应原生 HOOks 时捕获错误错误
【发布时间】:2021-04-10 14:17:11
【问题描述】:

所以我正在尝试使用异步存储并尝试验证它们是否是异步数据.. here is my code here is the error

我无法通过...进行验证

【问题讨论】:

  • 请将您的代码作为文本而不是图像包含,以保留使用的代码以供日后使用。

标签: react-native react-hooks react-native-navigation react-dom react-async


【解决方案1】:

你应该在你的代码之外调用钩子

   const readData = ...


   useEffect(() => {
     const timeout = setTimeout(() => readData(), 5000)
     return () => { clearTimeout(timeout) }
   }, [])


下次用代码发布代码问题。

【讨论】:

    猜你喜欢
    • 2022-01-23
    • 2017-10-21
    • 2018-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-02
    相关资源
    最近更新 更多