【问题标题】:What is React Native Web?什么是 React Native Web?
【发布时间】:2020-07-19 17:48:33
【问题描述】:

根据docs

React Native 可以为 Android 和 iOS 创建原生应用 使用 React。

但我对 React Native Web 感到困惑。 根据github home

“React Native for Web”使得使用 React DOM 在 Web 上运行 React Native 组件和 API 成为可能。

我没有!

这是 React Native 官方支持的库,用于编译 React Native 移动应用程序,作为 Web 应用程序从相同的代码库在 Web 上运行,就像我们在 Flutter 中所做的那样?

【问题讨论】:

  • 你不能在浏览器中运行 react-native 项目。您需要运行模拟器或连接真实设备才能使其工作。 React Native Web 用于在 Web 浏览器中运行 React Native 项目。

标签: reactjs react-native react-native-web


【解决方案1】:

Ciao,您知道要调试 React Native 项目,您必须在模拟器(Expo、Android 模拟器...)上运行它。不再需要react-native-web!您可以直接在浏览器中运行您的 React Native 项目!

【讨论】:

  • 好的,但是该功能仅用于开发期间的测试目的,还是我们可以将我们的 React Native 应用程序作为 Web 应用程序部署到生产环境?
  • Ciao,这只是为了测试目的。
猜你喜欢
  • 1970-01-01
  • 2020-01-31
  • 2020-04-28
  • 2020-03-18
  • 2023-03-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多