如何将react native web与Typescript一起使用
我已经使用如何将react native web与Typescript一起使用,typescript,react-native,react-native-web,Typescript,React Native,React Native Web,我已经使用create react native app创建了应用程序。我用于运行和生成生产版本的命令有: "scripts": { "web": "react-scripts start", "build": "react-scripts build" } 对于react-native,我可以使用react-native脚本ts,但如何使用react-native web配置Typescript管道?因此解决方案是使用: "scripts": { "test": "jest"
create react native app
创建了应用程序。我用于运行和生成生产版本的命令有:
"scripts": {
"web": "react-scripts start",
"build": "react-scripts build"
}
对于react-native,我可以使用
react-native脚本ts
,但如何使用react-native web配置Typescript管道?因此解决方案是使用:
"scripts": {
"test": "jest",
"web": "react-scripts-ts start",
"build": "react-native-scripts-ts build",
"test:web": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
并使用以下工具运行App.tsx:
AppRegistry.registerComponent("root", () => App);
AppRegistry.runApplication('root', { rootTag: document.getElementById('root') });