2 ms·
The way Suspense works is actually even a bit more interesting/horrifying: it doesn’t throw an error, it throws a Promise. Which again you don’t need to know to
by eyelidlessness 3y ago
The way Suspense works is actually even a bit more interesting/horrifying: it doesn’t throw an error, it throws a Promise. Which again you don’t need to know to use it, and so it’s a valid implementation detail, but it’s a really odd one.
- SebastianKra 3y agoTo be fair, in js, throwing is the only way a function (aka Hook) can abort the execution of its calling function (aka Component). The decision to avoid a custom compiler is responsible for almost all oddities and downsides of React.