Skip to content

Rename ErrorFallback to CustomErrorBoundary#95423

Open
theyoungwolf-dev wants to merge 1 commit into
vercel:canaryfrom
theyoungwolf-dev:patch-1
Open

Rename ErrorFallback to CustomErrorBoundary#95423
theyoungwolf-dev wants to merge 1 commit into
vercel:canaryfrom
theyoungwolf-dev:patch-1

Conversation

@theyoungwolf-dev

Copy link
Copy Markdown

For Contributors

Improving Documentation

What?

Renames the example component in the "Handling uncaught exceptions" section of the Error Handling doc (app/getting-started/error-handling.mdx) from ErrorFallback to CustomErrorBoundary for consistency.

Why?

The component passed to unstable_catchError is defined as ErrorFallback, but immediately imported and used under a different name, ErrorBoundary, in the following example:

export default catchError(ErrorFallback)
import ErrorBoundary from './custom-error-boundary'

While this is valid code since the default export can be imported under any local name, but having two different names for the same component in adjacent code samples is confusing for readers trying to follow the example, especially since the file is named custom-error-boundary.tsx. This PR uses one consistent name, CustomErrorBoundary, matching the filename, throughout both the definition and usage examples.

How?

Renamed ErrorFallback → CustomErrorBoundary in both the .tsx and .jsx code blocks, and updated the import/usage in the following some-component examples to match. No behavioral or API changes.

Closes NEXT-
Fixes #

The Custom Error boundary component is named ErrorFallback whereas the usage refers to it as ErrorBoundary (causing confusion). Name them all consistently to CustomErrorBoundary, same as the filename custom-error-boundary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant