3

我已经使用create-react-native-app. 我用来运行和进行生产构建的命令是:

"scripts": {
  "web": "react-scripts start",
  "build": "react-scripts build"
}

对于 react native 我可以使用react-native-scripts-ts,但是如何使用 react-native-web 配置 Typescript 管道?

4

1 回答 1

0

所以解决方案是使用:

"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') });
于 2018-07-30T11:24:17.157 回答