【问题标题】:Is there a way to call a React Native function from Native Android Code?有没有办法从 Native Android Code 调用 React Native 函数?
【发布时间】:2021-12-16 13:18:36
【问题描述】:

寻找一种从原生 Android 代码调用 React Native 函数的方法。

提前致谢。

【问题讨论】:

    标签: android reactjs react-native mobile


    【解决方案1】:

    在 react native 文档中检查这个。

    https://reactnative.dev/docs/communication-ios#calling-react-native-functions-from-native-events

    创建自定义原生组件后,您可以触发事件并在 react native 中处理这些事件。

    ios:https://reactnative.dev/docs/native-components-ios#events

    机器人:https://reactnative.dev/docs/native-components-android#events

    【讨论】:

      猜你喜欢
      • 2011-07-27
      • 2022-10-23
      • 2016-12-26
      • 1970-01-01
      • 1970-01-01
      • 2020-03-24
      • 2021-06-28
      • 2021-10-22
      • 1970-01-01
      相关资源
      最近更新 更多