GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(react): Change resetError to a function type property by wolfgang42 · Pull Request #26717 · getsentry/sentry-javascript

Conversation

@wolfgang42

@wolfgang42 wolfgang42 commented Nov 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What

Remove spurious this binding requirement from React ErrorBoundary FallbackMethod resetError.

Why

Typing it as a method is equivalent to:

    resetError: (this: FallbackMethod) => void,

Thus, tools like @typescript-eslint/unbound-method would warn on normal fallback code:

    function Fallback({resetError}) {
        return <button onClick={resetError}>Try again</button>;
    }

However, the actual value here is an arrow function which does not care about this at all:

sentry-javascript/packages/react/src/errorboundary.tsx

Line 201 in 463e8da

resetError: () => this.resetErrorBoundary(),

So, change the type to () => void, which matches what we actually pass and makes it clear that callers to not need to bind it as a method.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@wolfgang42
fix(react): Change resetError to a function type property
31f63f9
Typing it as a method is equivalent to:

    resetError: (this: FallbackMethod) => void,

Thus, tools like `@typescript-eslint/unbound-method` would warn on normal
fallback code:

    function Fallback({resetError}) {
        return <button onClick={resetError}>Try again</button>;
    }

However, the actual value here is an arrow function which does not care
about `this` at all:

    resetError: () => this.resetErrorBoundary(),

So, change the type to `() => void`, which matches what we actually pass
and makes it clear that callers to not need to bind it as a method.
@github-actions github-actions Bot added the external PR from an external contributor label Nov 20, 2026
@javascript-sdk-gitflow
javascript-sdk-gitflow Bot requested review from chargome, msonnb and nicohrubec November 20, 2026 20:30
@msonnb
msonnb changed the base branch from master to develop November 23, 2026 08:20
andreiborza
andreiborza approved these changes Nov 23, 2026
View reviewed changes

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @wolfgang42, thanks for the contribution. LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andreiborza
Merge branch 'develop' into patch-1
93a7f73
nicohrubec
nicohrubec approved these changes Nov 23, 2026
View reviewed changes
msonnb
msonnb approved these changes Nov 23, 2026
View reviewed changes
@msonnb
msonnb merged commit 15b69dd into getsentry:develop Nov 23, 2026
142 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@javascript-sdk-gitflow javascript-sdk-gitflow Bot mentioned this pull request Nov 23, 2026
chore: Add external contributor to CHANGELOG.md #26743
Merged
msonnb added a commit that referenced this pull request Nov 23, 2026
@javascript-sdk-gitflow @msonnb
chore: Add external contributor to CHANGELOG.md (#26743)
41856af
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #26717

Co-authored-by: msonnb <[email protected]>
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 23, 2026
publish: getsentry/[email protected] getsentry/publish#10541
Closed
51 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@msonnb msonnb msonnb approved these changes
@nicohrubec nicohrubec nicohrubec approved these changes
@andreiborza andreiborza andreiborza approved these changes
@chargome chargome Awaiting requested review from chargome

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

external PR from an external contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@wolfgang42 @msonnb @nicohrubec @andreiborza
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.