GithubHelp home page GithubHelp logo

Comments (9)

maraujop avatar maraujop commented on May 24, 2024 6

I was hitting this "bug" repeated times after upgrading RN > 0.50 Today I found out that this is due to the new error boundary handling in React 16. You can use componentDidCatch in a root component of your app to handle these scenarios.

You can read more about it here:
https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html

from react-native-exception-handler.

andrew-wagner89 avatar andrew-wagner89 commented on May 24, 2024 3

I'm also having a similar problem problem. Regular errors are being caught correctly, but a TypeError in a render caused by a promise isn't caught and the red screen shows on both debug and release builds

from react-native-exception-handler.

a7ul avatar a7ul commented on May 24, 2024

Hmm. That's interesting @Kebabpizza . I ll take a look at that . But @andrew-wagner89 Red screen should never come in the release builds. .as they are entirely switched off during the build process.

from react-native-exception-handler.

a7ul avatar a7ul commented on May 24, 2024

Hi @Kebabpizza @andrew-wagner89 Can you guys help with a screenshot or a larger snippet? .. I am only getting a warning yellow screen after trying to replicate. And yellow screens dont cause a app crash.

from react-native-exception-handler.

Kebabpizza avatar Kebabpizza commented on May 24, 2024

Hi @master-atul, apologies for the late response.

After navigating to another screen with react-navigation, this produces a crash (red screen) instead of a yellow warning. And if you navigate within a promise react-native-exception-handler does not catch this.

Here is a sample: https://gist.github.com/Kebabpizza/925531ed9bab37ba6abf48f5de9c812a

using
[email protected]
[email protected]
[email protected]
[email protected]

from react-native-exception-handler.

tonypee avatar tonypee commented on May 24, 2024

im experiencing this too, which made me think it isnt working at all

from react-native-exception-handler.

yugandhar-pathi avatar yugandhar-pathi commented on May 24, 2024

It behaves bit peculiar for me. I tried the example given in the documentation of this plugin (like this.test() ).
I kept this code ( this.test() ) in one of the component life cycle methods, it didn't catch the error !!
Same code( this.test() ) I wrote in one of the button handlers in my component it did catch the error !!

I am not sure why this behavior ??

from react-native-exception-handler.

yugandhar-pathi avatar yugandhar-pathi commented on May 24, 2024

I was hitting this "bug" repeated times after upgrading RN > 0.50 Today I found out that this is due to the new error boundary handling in React 16. You can use componentDidCatch in a root component of your app to handle these scenarios.

You can read more about it here:
https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html

That's great! So we don't need this plugin any more right ?

from react-native-exception-handler.

aroshanzamir avatar aroshanzamir commented on May 24, 2024

What we have to do in functional component (there is not componentDidCatch)?

from react-native-exception-handler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.