[에러대백과] 리액트 Suspense 사용하고 에러나는 경우 Feed suspended while rendering, but no fallback UI was specified

2022. 7. 31. 17:32WEB Dev/에러대백과

728x90

 

리코일 셀렉터를 이용하면서 값이 받아와지기 전에 suspense를 이용하면 로딩 된 후 UI를 표시할 수 있다 하여 Suspense 컴포넌트를 적용했는데 계속 아래와 같은 에러가 떴다.

 

Uncaught Error: Feed suspended while rendering, but no fallback UI was specified.

Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.

 

 

스택오버플로우에 검색해보니 두 가지 해결책을 주는데 가장 간단한 방법은 해당 오류가 나는 컴포넌트의 상위 컴포넌트에 Suspense를 적용해주는 것.

App.js에서 감싸줘도 된다.

 

 

 

A React component suspended while rendering, but no fallback UI was specified

I just started working on this new React app. It was using <Suspense /> element in the component but I removed it. Then application is crashed with above error. Is there any easy fix with...

stackoverflow.com

 

728x90