Skip to content
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

Move use to APIs #6774

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Move use to APIs #6774

merged 2 commits into from
Apr 24, 2024

Conversation

kassens
Copy link
Collaborator

@kassens kassens commented Apr 24, 2024

use is not a Hook as it can be called conditionally. This moves it to the React APIs section in the reference and refers to it as a React API instead of React Hook.

Copy link

vercel bot commented Apr 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2024 7:55pm

Copy link

github-actions bot commented Apr 24, 2024

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/[[...markdownPath]] 81.65 KB (-3 B) 185.56 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just port the resource info

@@ -106,24 +106,6 @@ To prioritize rendering, use one of these Hooks:

---

## Resource Hooks {/*resource-hooks*/}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to apis.md? It can also explain that it can only be called in render, like a hook, but can be called conditionally, unlike a hook.

@kassens kassens merged commit 9fb2f0d into reactjs:main Apr 24, 2024
5 checks passed
@kassens kassens deleted the use-api branch April 24, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants