Skip to content

Commit

Permalink
docs: Add faq (#34830)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Apr 1, 2022
1 parent dd13e80 commit 80c1391
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/react/faq.en-US.md
Expand Up @@ -126,6 +126,10 @@ ConfigProvider.config({
});
```

### Why shouldn't I use component internal props or state with ref?

You should only access the API by official doc with ref. Directly access internal `props` or `state` is not recommended which will make your code strong coupling with current version. Any refactor will break your code like refactor with [Hooks](https://reactjs.org/docs/hooks-intro.html) version, delete or rename internal `props` or `state`, adjust internal node constructor, etc.

### How to spell Ant Design correctly?

-**Ant Design**: Capitalized with space, for the design language.
Expand Down
4 changes: 4 additions & 0 deletions docs/react/faq.zh-CN.md
Expand Up @@ -140,6 +140,10 @@ ConfigProvider.config({
});
```

### 为什么我不应该通过 ref 访问组件内部的 props 和 state?

你通过 ref 获得引用时只应该使用文档提供的方法。直接读取组件内部的 `props``state` 不是一个好的设计,这会使你的代码与组件版本强耦合。任何重构都可能会使你的代码无法工作,其中重构包括且不仅限于改造成 [Hooks](https://reactjs.org/docs/hooks-intro.html) 版本、移除 / 更名内部 `props``state`、调整内部 React 节点结构等等。

### 如何正确的拼写 Ant Design?

-**Ant Design**:用空格分隔的首字母大写单词,指代设计语言。
Expand Down

0 comments on commit 80c1391

Please sign in to comment.