-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(cn): translate reference/react/experimental_useEffectEvent into Chinese #1161
Merged
Yucohny
merged 8 commits into
reactjs:main
from
earthaYan:reference/react/experimental_useEffectEvent
Jun 28, 2023
+4
−4
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ac7064b
docs(cn): translate reference/react/experimental_useEffectEvent into …
earthaYan 6070ea7
Merge branch 'main' into reference/react/experimental_useEffectEvent
earthaYan 59563c2
Update src/content/reference/react/experimental_useEffectEvent.md
earthaYan a487ac2
fix from review suggestion
earthaYan 1fbd981
fix from review suggestion
earthaYan fbd858c
Merge branch 'main' into reference/react/experimental_useEffectEvent
earthaYan 5fb74e8
Merge branch 'main' into reference/react/experimental_useEffectEvent
Yucohny 329c0fa
docs(cn): review and update
Yucohny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
--- | ||
title: experimental_useEffectEvent | ||
title: 实验性的 useEffectEvent | ||
--- | ||
|
||
<Wip> | ||
|
||
**This API is experimental and is not available in a stable version of React yet.** | ||
**这个 API 实验性的且在 React 的稳定版中还不可用**。 | ||
|
||
You can try it by upgrading React packages to the most recent experimental version: | ||
你可以通过升级到最新的实验版 React 包来尝试: | ||
|
||
- `react@experimental` | ||
- `react-dom@experimental` | ||
- `eslint-plugin-react-hooks@experimental` | ||
|
||
Experimental versions of React may contain bugs. Don't use them in production. | ||
React 实验版可能存在 bug,所以千万不要在生产环境使用它。 | ||
|
||
</Wip> | ||
|
||
|
||
<Intro> | ||
|
||
`useEffectEvent` is a React Hook that lets you extract non-reactive logic into an [Effect Event.](/learn/separating-events-from-effects#declaring-an-effect-event) | ||
`useEffectEvent` 这个 React Hook 让你可以提取非响应式逻辑到一个 [Effect Event](/learn/separating-events-from-effects#declaring-an-effect-event) 中。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可以考虑此处的 Event 是否需要翻译 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Effect Event特指useEffectEvent包裹后的结果,感觉好像不应该翻译 |
||
|
||
```js | ||
const onSomething = useEffectEvent(callback) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这应该是 API 的完整名称吧……
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,已修改