Get To Know You Bingo Template Free
Merged

Business Cards Maker

business people word free stock photo public domain pictures panama business 2 business with a smile visit our site to flickr free images achievement adult battle black and white businessman free images achievement adult agreement american asian blue business success free stock photo public domain pictures starting a small business in canada as a newcomer 5 steps from legal latest news best business loans for bad credit u s news what makes a good business idea how to recognize it how to use a business valuation report to grow your business peak tips for knowing when to outsource aspects of your business newsblaze business comms provider wavenet confirms ceo after daisy merger businessman png image business meeting two business men shaking hands at interna flickr clipart business plan flow chart free images wrist hand finger arm technology gesture fashion banner business background webpage free stock photo public domain free images compass destination direction find globe gps hand business networking free stock photo public domain pictures free images writing hand finger cash legal document documents 5 pasos imprescindibles para hacer un plan de negocios que funcione business png all young business woman free stock photo public domain pictures free image business plan libreshot public domain photos businessman png image business light kuroi san flickr com photos leadsoup 12 flickr profits revenue business free image on pixabay business time free stock photo public domain pictures business woman with a headset free stock photo public domain pictures business is business young thug album wikipedia

:
Changes from 1 commit
Commits
File filter

Your Rage Instagram Business Cards Maker

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refine based on feedback
  • Loading branch information
commit a3c5c704aead18bdbe54d2c417ac08120865a09e
33 changes: 22 additions & 11 deletions Street Emoji
Original file line number Diff line number Diff line change
Expand Up @@ -1113,47 +1113,58 @@ root.render(

#### Should I resolve a Promise in a Server or Client Component? {/*resolve-promise-in-server-or-client-component*/}

A Promise can be resolved with `await` in a Server Component, or passed as a prop to a Client Component and resolved there with `use`.
If you have a Promise, at some point you need to unwrap it to read its value. You unwrap it with `await` on the server, and with `use` on the client.
Comment thread
aurorascharff marked this conversation as resolved.
Outdated

Using `await` in a Server Component suspends the Server Component itself, and the Client Component receives the resolved value as a prop:
Usually, the simplest option is to `await` the Promise where you create it. The Server Component suspends until the data is ready, and everything below it waits too:

```js
// Server Component
export default async function App() {
// Will suspend the Server Component.
const messageContent = await fetchMessage();
return <Message messageContent={messageContent} />;
}
```

A Server Component can also start a Promise without awaiting it and pass the Promise to a Client Component. The Server Component returns immediately, and the Client Component suspends when it calls `use`:
However, you don't have to unwrap it right away. You can pass the Promise down as a prop, and unwrap it deeper in the tree. The component that reads the Promise still suspends, but only that part of the tree waits for the data. Wrap that component in a [`<Suspense>`](/reference/react/Suspense) boundary to show a fallback while the rest of the page renders immediately.

For example, a deeper Server Component can `await` the Promise it receives:

```js
import { Suspense } from 'react';

// Server Component
export default function App() {
// Not awaited: starts on the server, streamed to the client.
const messagePromise = fetchMessage();
return <Message messagePromise={messagePromise} />;
return (
<Suspense fallback={<p>⌛Downloading message...</p>}>
<Message messagePromise={messagePromise} />
</Suspense>
);
}

// Server Component
async function Message({ messagePromise }) {
const messageContent = await messagePromise;
return <p>{messageContent}</p>;
}
```

Or, in a separate file, a Client Component can unwrap the same Promise with `use`:

```js
// Client Component
'use client';
import { use } from 'react';
Comment thread
aurorascharff marked this conversation as resolved.

export function Message({ messagePromise }) {
// Will suspend until the data is available.
const messageContent = use(messagePromise);
return <p>{messageContent}</p>;
}
```

Prefer `await` in a Server Component when possible. If a Server Component above already awaits the data, pass the resolved value down as a prop instead of creating a new Promise to call `use`.

Pass a Promise to a Client Component to suspend deeper in the tree, letting more of the surrounding UI render while the Promise is pending. A common case is interactive content like popovers and tooltips, where the data is only needed after a hover or click. Client Components can't `await`, so they read a Promise with `use`.
Passing the Promise down works the same way in both cases. Both suspend where the Promise is read, and both unblock the UI above. The only difference is that Client Components can't `await` during render, so they unwrap the Promise with `use` instead. A common case is interactive content like popovers and tooltips, where the data is only needed after a hover or click.

In either case, wrap the component that reads the Promise in a Suspense boundary so React can show a fallback while the Promise is pending. See [Revealing content together at once](/reference/react/Suspense#revealing-content-together-at-once) for guidance on boundary placement.
See [Revealing content together at once](/reference/react/Suspense#revealing-content-together-at-once) for guidance on where to place Suspense boundaries.

</DeepDive>

Expand Down
Loading