Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning about missing getDerivedStateFromError in error boundary #102

Closed
bxt opened this issue Mar 24, 2020 · 0 comments
Closed

Warning about missing getDerivedStateFromError in error boundary #102

bxt opened this issue Mar 24, 2020 · 0 comments

Comments

@bxt
Copy link

bxt commented Mar 24, 2020

Expected behavior

No React warnings should be logged from usage of intersection observer.

Current behavior

When an error is created inside intersection observer, the following warning is created by React:

react_devtools_backend.js:6 Warning: ErrorBoundary(IntersectionObserver): Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
    in ErrorBoundary(IntersectionObserver) (created by IntersectionObserver)
    in IntersectionObserver (created by App)
    // ...

The warning was added in React 16.6.0 (facebook/react#13746)

Steps to reproduce

You can use the code from #101 to create an example error. You will see the warning in the developer console when React runs in development mode.

Context (environment)

  • Version: 1.1.0 / 1.1.1
  • Platform: Darwin host 18.7.0 Darwin Kernel Version 18.7.0: Thu Jan 23 06:52:12 PST 2020; root:xnu-4903.278.25~1/RELEASE_X86_64 x86_64
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

No branches or pull requests

2 participants