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

Handle React component failures gracefully #72

Closed
ekelen opened this issue Apr 17, 2020 · 2 comments
Closed

Handle React component failures gracefully #72

ekelen opened this issue Apr 17, 2020 · 2 comments
Assignees
Labels

Comments

@ekelen
Copy link
Collaborator

ekelen commented Apr 17, 2020

Perhaps with Error Boundaries.

I haven't used them before, but they can allow us to gracefully catch problems rendering components.

Maybe @appigram can give some guidance :)

@ekelen ekelen self-assigned this Apr 17, 2020
@appigram
Copy link
Collaborator

appigram commented Apr 17, 2020

Hi @ekelen . You can copy ErrorBoundry implementation from Depviz repo https://github.com/moul/depviz/tree/master/web/src/ui/components/ErrorBoundary and wrap any component, like I did for Visualizer, or wrap a whole App component to catch any app bugs, like

<ErrorBoundary>
    {rendererBlock}
 </ErrorBoundary>

You can modify ErrorBoundary component to send custom error message as prop, and/or leave error stack for main components. Hope it helps :-)

GitHub
👓 dependency visualizer for GitHub & GitLab (a.k.a., "auto-roadmap") - moul/depviz

@moul moul added the front label Apr 22, 2020
@moul moul added this to Triage in Yolo's Kanban Apr 30, 2020
@moul moul closed this as completed Oct 1, 2020
Yolo's Kanban automation moved this from Triage to Done Oct 1, 2020
@moul
Copy link
Member

moul commented Oct 1, 2020

moved to #2

@moul moul mentioned this issue Oct 1, 2020
84 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Yolo's Kanban
  
Done
Development

No branches or pull requests

3 participants