【问题标题】:Invariant Violation: not usable as a native method argument不变违规:不能用作本机方法参数
【发布时间】:2022-08-19 19:21:58
【问题描述】:

这个 react native 应用在 Snack.io 中运行流畅。但是,在将其迁移到 VS 代码并安装 yarn 后,它会出现这些错误。可能是什么问题?有没有人遇到过类似的事情?错误可以在下面看到。我对 React JS 很陌生,任何帮助将不胜感激。

Error: Invariant Violation: [103,\"RCTView\",{\"accessibilityValue\":{\"min\":0,\"max\":100,\"now\":\"<<NaN>>\"}}] is not usable as a native method argument
This error is located at:
    in RCTView (created by View)
    in View (created by ProgressBar)
    in ProgressBar
    in ThemedComponent (created by withTheme(ProgressBar))
    in withTheme(ProgressBar) (created by Timer)
    in RCTView (created by View)
    in View (created by Timer)
    in RCTView (created by View)
    in View (created by Timer)
    in Timer (created by App)
    in RCTSafeAreaView
    in SafeAreaView (created by App)
    in App (created by ExpoRoot)
    in ExpoRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in DevAppContainer (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent)
 ERROR  Error: Exception in HostFunction: <unknown>

This error is located at:
    in AnimatedComponent
    in AnimatedComponentWrapper (created by ProgressBar)
    in RCTView (created by View)
    in View (created by ProgressBar)
    in ProgressBar
    in ThemedComponent (created by withTheme(ProgressBar))
    in withTheme(ProgressBar) (created by Timer)
    in RCTView (created by View)
    in View (created by Timer)
    in RCTView (created by View)
    in View (created by Timer)
    in Timer (created by App)
    in RCTSafeAreaView
    in SafeAreaView (created by App)
    in App (created by ExpoRoot)
    in ExpoRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in DevAppContainer (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent)

标签: javascript reactjs react-native yarnpkg snackjs


【解决方案1】:

如果是,您是否在代码中使用了动画,而不是请评论。如果你想不通,只做一件事评论整个代码而不是一一取消注释,你会发现问题出在哪里。

【讨论】:

    猜你喜欢
    • 2020-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-13
    • 2018-05-25
    • 1970-01-01
    • 2016-09-29
    相关资源
    最近更新 更多