TypeScript和React的启动模板,并附有详细的README描述如何将两者一起使用.
今取此还取已堕. 在它创建TypeScript支持后的时间里,现在是一个默认的功能,即创造出React App,Next.js和[RUL3Z].
这意味着你可以开始:
(原始内容存档于2019-09-29) (英语). ```sh
npx create-react-app my-app --typescript
cd my-app
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
echo "Good to go :tada:"
这个Repo提供了一些实例,说明如何将该项目投入生产并处理测试和状态. 不过,你可以
还为此使用Create React App网站上的官方文档.
如果你想更多地了解如何有效使用React,我们建议研究以下几点:
- [React+TypeScript] (ZZURL4Z) - [ZZURL4Z] - [ZZTERM7+TypeScript] (ZZURL4Z).
- [React & Redux 在TypeScript - 静态打字指南] (https://github.com/piotrwitek/react-redux-typescript-guide#react--redux-in-typescript---static-typing-guide)
- [利用TypeScript开发React应用](https://egghead.io/courses/use-typescript-to-develop-react-applications).
- [Ultimate React 组件型式有TypeScript 2.8] (https://levelup.gitconnected.com/ultimate-react-component-patterns-with-typescript-2-8-82990c516935)
下面是这个样本的原始README.
-- -- . . .
{\fn方正粗倩简体\fs12\an8\1cHFFFF00\b0}TypeScript React 启动器
这个快速启动指南将教你如何用[React](ZZURL8Z)来接通TypeScript.
到最后,你会有
* 与React和TypeScript的项目
* 与 [TSLint] (https://github.com/palantir/tslint) 连线
* 使用[正 (https://facebook.github.io/jest/)和[ Enzyme (http://airbnb.io/enzyme/)进行试验,以及
* 国家管理与[Redux] (https://github.com/reactjs/react-redux)
我们将使用[创建-React-app](ZZURL13Z)工具快速被设置.
我们假设你已经用 [Node.js] (https://nodejs.org/) 与 [npm] (https://www.npmjs.com/).没有导出的成员 'Dispatch'。
支持 sass 加载器
背景: url(); 不起作用
找不到名称 'Cheerio'。
缺少属性 'name'
我在导入图像时遇到了问题
错误 TS2604: JSX 元素类型 'Provider' 没有任何构造函数或调用签名。
TS 错误: 只有带有 'new' 关键字的 void 函数才能调用。ts(2350)
运行 `npm run start` 时出现了许多错误
create-react-app-TypeScript 已被弃用