mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Extends the error components API to give better control over recovery. Previously, the `reset()` prop only cleared the error state and re-rendered the children. However, this only handles a temporary rendering error. The error can be due to data fetching or an RSC phase. In these cases, `reset()` alone is not sufficient. Users would even need to implement retry logic using `router.refresh()`. Therefore, this PR adds a new `unstable_retry()` prop that calls `router.refresh()` and `reset()` within a `startTransition()` to provide built-in retry logic. This feature is expected to be preferred over the `reset()` prop. Only the cases where you'd choose `reset()` are when you have a reason to do a sync reset without loading any new data. Closes NAR-767