You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用npx react-native init创建React Native项目时如何生成JavaScript而非TypeScript?

创建React Native JavaScript项目的方法

从React Native 0.70版本开始,npx react-native init命令默认会生成TypeScript项目。如果要创建纯JavaScript项目,只需在初始化命令中指定官方的JavaScript模板:

  • 使用以下命令创建JavaScript项目:
    npx react-native init APP_NAME --template react-native-template-basic
    

执行该命令后,生成的项目会以.js和.jsx文件为主,而非TypeScript的.ts/.tsx文件,完全符合你的需求。

内容的提问来源于stack exchange,提问作者Akshay PandherPatte

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 08:10:25