React Suspense Without using Lazy

  Kiến thức lập trình

Till now i know React suspense uses promises to handle async rendering and fallback rendering which we can achieve using React.lazy for dynamic import. But i have read that we can also use suspense without lazy. But now how it work now?
And try to explain with example with Async component which uses setTimeOut which resolve promise after 2sec. and render main content after 2sec fallback ui.

And try to explain with example with Async component which uses setTimeOut which resolve promise after 2sec. and render main content after 2sec fallback ui.

New contributor

Dhruv Property is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT