Crowdbotics Articles About

React Suspense

What is React Suspense?

React Suspense is a new feature that was announced at the 2019 React Conf. In brief, it allows an application to delay rendering of a component if it is not currently necessary for user interaction. For example, if the user has been inactive on a page for 1 minute and the component will not be needed until 5 minutes from now, React Suspense may decide to delay rendering until 2 minutes have passed. React Suspense can also intelligently determine the boundary between unneeded and needed components – so if you show a video player but don't need to render controls or metadata until you start playing the video, those elements will be delayed as well. It's important to note that because this feature relies on requestIdleCallback , it only works in browsers that support requestIdleCallback . At present, only Chrome supports this API for real-world applications, but other browsers are expected

Articles related to React Suspense cover how it works, what it is used for, and how to write code that uses it. Additional topics related to React Suspense include functional stateless components, asynchronous data loading, and component lifecycles.