我输入命令以使用 typescript 创建 React Native 项目。
npx react-native init MyApp --template react-native-template-typescript
包.json
"react-native": "0.63.2"
我想用打字稿创建 0.62.2,所以我尝试以下命令:
npx react-native init MyApp --version 0.62.2 --template react-native-template-typescript
包.json
"react-native": "0.63.0"
是 0.63.0 而不是 0.62.2
为什么我无法使用 typescript 创建 0.62.2 ?
对于typescript模板,react native的版本取决于react-native-template-typescript版本,例如:
- r[电子邮件受保护] /cdn-cgi/l/email-protection --> [电子邮件受保护] /cdn-cgi/l/email-protection
- r[电子邮件受保护] /cdn-cgi/l/email-protection --> [电子邮件受保护] /cdn-cgi/l/email-protection
因此如果你想安装版本[电子邮件受保护] /cdn-cgi/l/email-protection,您需要像这样应用命令:
npx react-native init AwesomeTSProject --template [email protected] /cdn-cgi/l/email-protection
更多信息:React-native-template-typescript 发布 https://github.com/react-native-community/react-native-template-typescript/releases
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)