Skip to content

Make compatible with componentDidCatch #8

@heygrady

Description

@heygrady

It should be possible to see that a component has a componentDidCatch method. It would be nice if react-guard could optionally only catch errors at those error boundaries.

The issue is that we want/need to use the client-side error boundary on the client. The official solution allows us to define precisely how the errors are shown. But with react-guard on the server-side, we lose that control.

For example, imagine that the SVG icon in a submit button is throwing an error. On the client I can catch that at the form level and give the user a really nice message that replaces the whole form. This is a great user experience.

By contrast, react-guard would replace only that icon with a generic message. This might lead to a poor user experience.

Forgive me if I am missing something about how react-guard works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions