是否有任何用于 reactjs 和 react-native 的样板

is there any boilerplates for a reactjs and react-native

我们正在使用 reactjs 开始一个新的 webapp,我们选择 react 的主要原因是因为 react-native!,该应用程序将受到密码保护,因此我们不会利用和 seo 或服务器渲染功能。

我发现大多数用于 React 的样板都集中在通用设置上,但就我而言,我想构建应用程序以在 Web 和移动应用程序之间共享尽可能多的代码

我们使用 https://github.com/mxstbr/react-boilerplate

启动了我们的网络应用程序

是否有可用于此类用例的生产就绪 boilerplate/starter?

我认为您尝试在 React 和 React Native 之间共享大量代码还为时过早。 Ben Alpert,Facebook 的 React 核心团队成员之一,在 recent AMA:

中这样说

Over time, maybe we can share view code between native and web too. There are some cool projects in the community like react-native-web (https://github.com/necolas/react-native-web) which try to make this possible. We don't have anything to show at Facebook yet down this road but maybe in a year or two we could officially support using View, Image, and Text on the web for people who want to.

(强调我的)

对于 React Native,我建议您看一下 Ignite by Infinite Red (disclaimer: I'm one of the owners of Infinite Red). It gives you a great starting point and provides a lot of tools (including the fantastic Reactotron) 以助您一臂之力。

Create React App 是开始构建新的 React 单页应用程序的最佳方式。它设置您的开发环境,以便您可以使用最新的 JavaScript 功能,提供良好的开发人员体验,并针对生产优化您的应用。

Create React Native App 是开始构建新的 React Native 应用程序的最简单方法。它允许您在不安装或配置任何工具来构建本机代码的情况下启动项目 - 无需 Xcode 或 Android Studio 安装。