This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Working sample can be found on this link: https://codesandbox.io/s/jovial-haze-4q9fk | |
* | |
* Errors found: | |
* 1. First error on SuspensefulUserProfile component was the way the data is being fetched. | |
* This is a Fetch-on-Render approach, instead of fetching and rendering at the same time (Updated to use that one) | |
* | |
* 2. fallback prop must be set as prop on Suspense | |
* 3. I would add and ErrorBoundary so in case it fails thats handled | |
* 4. This is not an error but we could also add SuspenseList to handle the display order (still only on experiment version I think) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, ErrorInfo, ReactNode } from 'react'; | |
interface ErrorBoundaryState { | |
hasError: boolean; | |
} | |
interface ErrorBoundaryProps { | |
children: ReactNode | |
} |