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

Grammar fix #3

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion text/0000-first-class-support-for-promises.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ Even though `use` can be [called conditionally](#conditionally-suspending-on-dat

Theoretically, it will "work" in the runtime if you call `use` inside a function which itself is only called from inside a React component or Hook, but this will be treated as a compiler error.

If we allowed `use` to be called in regular functions, it would be up to the developer to keep track of whether it was being in the right context, since there's no way to enforce this in the type systems of today. That was one of the reasons we created the "use"- naming convention in the first place, to distinguish between React functions and non-React functions.
If we allowed `use` to be called in regular functions, it would be up to the developer to keep track of whether it was being called in the right context, since there's no way to enforce this in the type systems of today. That was one of the reasons we created the "use"- naming convention in the first place, to distinguish between React functions and non-React functions.

It would also make it harder for a memoizing compiler to re-use computations, because it would have to assume that _any_ arbitrary function might possibly suspend.

Expand Down