-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
useTranslations support for async rsc #406
Comments
Hey @ddenizakpinar! This issue is closed as "completed", but I'm still getting this error with latest |
ref. vercel/next.js#51477 (comment) |
@ddenizakpinar can you please reopen this issue? I need use |
@rentalhost done |
I'll go into a bit more detail since this seems to be a popular question. The Server Components integration of To do this, we currently use the To work around this, we suggest splitting your component into an async and non-async part:
Many users have suggested an awaitable version of In my opinion, one of the biggest advantages of how the There's an argument that an additional API could be added specifically for async components, while still defaulting to
(from the first class promises RFC) Even if there's a decision that On a related note, using
(from the first class promises RFC) I hope this provides some background. From my experience, typically async Server Components are used mostly at the top of route handlers, followed by non-async components that render the data and potentially pass some of it to client components. In practice, there are occasionally cases where a call to A note on Some users have discovered that The general recommendation is to split components and stick to See also #276 |
I think it's about the fact that the use() api is only available in experimental and canary channels.I am using react 18.2.0 |
I just find out that |
Really? I couldn't reproduce this with the latest |
Sorry, it's my fault. I double examined the code and confirmed I was wrong. |
I've expanded my comment above to explain the current architectural direction in more detail, hope this helps! |
After writing the detailed comment above I gave the topic of the function signature of Based on this, the latest 3.0 release candidate The general recommendation is still to split components, as this will naturally result in the creation of shared components that work in either environment. I think based on this, this issue can be closed. Hope this helps! |
for async function use |
Is your feature request related to a problem? Please describe.
Currently
useTranslations
works fine with server components but when I convert the component to async it throwsError: Expected a suspended thenable. This is a bug in React. Please file an issue.
.Will there be a support for this situation?
Describe the solution you'd like
It should work as it is working on sync rsc
The text was updated successfully, but these errors were encountered: