Browse Source

📝 Fix use-in-typescript documentation

close #14776
pull/14780/head
afc163 6 years ago
parent
commit
c7a57302ed
No known key found for this signature in database GPG Key ID: 738F973FCE5C6B48
  1. 4
      docs/react/use-in-typescript.en-US.md
  2. 4
      docs/react/use-in-typescript.zh-CN.md
  3. 2
      docs/react/use-with-create-react-app.en-US.md
  4. 4
      docs/react/use-with-create-react-app.zh-CN.md

4
docs/react/use-in-typescript.en-US.md

@ -79,10 +79,10 @@ For instance, we actually import all styles of components in the project which m
Now we need to customize the default webpack config. We can achieve that by using [react-app-rewired](https://github.com/timarney/react-app-rewired) which is one of create-react-app's custom config solutions. Now we need to customize the default webpack config. We can achieve that by using [react-app-rewired](https://github.com/timarney/react-app-rewired) which is one of create-react-app's custom config solutions.
Import react-app-rewired and modify the `scripts` field in package.json. Import react-app-rewired and modify the `scripts` field in package.json. Due to new [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) issue, you shall need [customize-cra](https://github.com/arackaf/customize-cra) along with react-app-rewired.
``` ```
$ yarn add react-app-rewired $ yarn add react-app-rewired customize-cra
``` ```
```diff ```diff

4
docs/react/use-in-typescript.zh-CN.md

@ -78,10 +78,10 @@ export default App;
此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。 此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。
引入 react-app-rewired 并修改 package.json 里的启动配置。 引入 react-app-rewired 并修改 package.json 里的启动配置。由于新的 [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) 版本的关系,你需要还需要安装 [customize-cra](https://github.com/arackaf/customize-cra)。
``` ```
$ yarn add react-app-rewired $ yarn add react-app-rewired customize-cra
``` ```
```diff ```diff

2
docs/react/use-with-create-react-app.en-US.md

@ -95,7 +95,7 @@ For instance, we actually import all styles of components in the project which m
Now we need to customize the default webpack config. We can achieve that by using [react-app-rewired](https://github.com/timarney/react-app-rewired) which is one of create-react-app's custom config solutions. Now we need to customize the default webpack config. We can achieve that by using [react-app-rewired](https://github.com/timarney/react-app-rewired) which is one of create-react-app's custom config solutions.
Import react-app-rewired and modify the `scripts` field in package.json. Due to new `react-app-rewired@2.x` versions, you have to install customize-cra along with react-app-rewired. Import react-app-rewired and modify the `scripts` field in package.json. Due to new [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) issue, you shall need [customize-cra](https://github.com/arackaf/customize-cra) along with react-app-rewired.
``` ```
$ yarn add react-app-rewired customize-cra $ yarn add react-app-rewired customize-cra

4
docs/react/use-with-create-react-app.zh-CN.md

@ -90,9 +90,9 @@ export default App;
我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的样式(对前端性能是个隐患)。 我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的样式(对前端性能是个隐患)。
此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。由于新的 `react-app-rewired@2.x` 版本的关系,你必须安装 customize-cra 以及 react-app-rewired 。 此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。
引入 react-app-rewired 并修改 package.json 里的启动配置。 引入 react-app-rewired 并修改 package.json 里的启动配置。由于新的 [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) 版本的关系,你需要还需要安装 [customize-cra](https://github.com/arackaf/customize-cra)。
``` ```
$ yarn add react-app-rewired customize-cra $ yarn add react-app-rewired customize-cra

Loading…
Cancel
Save