Skip to content

React: Don't set react.componentStack context #20094

@timfish

Description

@timfish

In captureReactException we set a react context with the raw error.stack:

return withScope(scope => {
scope.setContext('react', { componentStack });
return captureException(error, hint);
});

This context will never have sourcemaps applied so it will be mostly useless to users. For React >= v17 the stack also gets included in the error and will have sourcemaps applied.

A user has asked why this context is set and I can't see a valid reason for it.

It might offer some context for React < v17 but it seems unlikely without sourcemaps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions