amo*_*new 6 reactjs webpack react-native
我想将React应用程序文件放在React Native应用程序中。
我使用React Native Web在React应用程序中支持React Native组件。
最后一步,我想将所有文件从React App文件夹放到React Native App文件夹。
区别在于Package.json
反应Package.json:
{
"name": "appname",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-scripts": "1.0.10"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Run Code Online (Sandbox Code Playgroud)
反应本机Package.json:
{
"name": "appname",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.47.1",
"react-native-windows": "0.47.0-rc.5"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.1.0",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12",
"rnpm-plugin-windows": "^0.2.7"
},
"jest": {
"preset": "react-native"
}
}
Run Code Online (Sandbox Code Playgroud)
那么是否可以将两个软件包合并在一起?
对于您的本机应用程序,您可以使用 React Native 中的 package.json,无需合并。您不需要本机应用程序中的“react-dom”和类似的库。如果你的组件全部来自React Native for Web,那么在本机上运行它们不会有问题。
| 归档时间: |
|
| 查看次数: |
409 次 |
| 最近记录: |