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

Returning a component from the error handler #144

Open
ianbayne opened this issue Nov 19, 2020 · 0 comments
Open

Returning a component from the error handler #144

ianbayne opened this issue Nov 19, 2020 · 0 comments

Comments

@ianbayne
Copy link

ianbayne commented Nov 19, 2020

Hi there, this is a neat project! I discovered it from this post: https://elazizi.com/handling-errors-in-react-native-a-complete-guide.

I have one question: Is it possible to return a component from the errorHandler? Something like the following:

const errorHandler = (error, isFatal) => {
  if (isFatal) {
    return <FallbackComponent />;
  } else {
    console.log(error);
  }  
};

setJSExceptionHandler(errorHandler, true);

export default function App() {
  // ...
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

1 participant