Why do we need await config in next.js server components?
#15049
-
|
All examples/templates contain server nextjs components which
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hey @evgeniyworkbel I don't think you need to await the config promise to be honest. Either way, it should work fine. More specifically, both I'm adding a few links below, so that you may look through the code and explore what these functions do, and where exactly your config gets threaded through to in this process. |
Beta Was this translation helpful? Give feedback.

Hey @evgeniyworkbel
I don't think you need to await the config promise to be honest. Either way, it should work fine.
More specifically, both
getPayloadandBasePayload.initwill await the config as appropriate. If you await the config promise in advance of callinggetPayload, then the behavior will be the same. The underlying code will await it anyway, and usingawaiton a resolved promise or primitive value doesn't cause any negative consequences or overhead as far as I'm aware. It is safe.I'm adding a few links below, so that you may look through the code and explore what these functions do, and where exactly your config gets threaded through to in this process.