48.2k views
1 vote
What property do you need to add to the Suspense component in order to display a spinner or loading state?

function MyComponent() {
return (





);
}

User Pocketsand
by
8.3k points

1 Answer

2 votes

Final answer:

To display a spinner or loading state in the Suspense component, you need to add the fallback property.

Step-by-step explanation:

To display a spinner or loading state in the Suspense component, you need to add the fallback property. The fallback property specifies the content that should be displayed while the component is loading. It can be a simple message or a loading spinner.

Here's an example:

function MyComponent() { return (Loading...}>...); }
User Soo Wei Tan
by
8.2k points