Use React-provided stacktrace in crash overlay
Created by: Timer
The recently merged crash overlay should support whitelisted warnings thrown by React.
Currently, this can be accomplished by enabling the console proxy via:
proxyConsole('error');
However, this relies on a synthetically generated stack-trace and not the stack-trace provided by React in the warning. e.g.
var error = void 0;
try {
throw new Error(message);
} catch (e) {
error = e;
}
This is problematic, however, because of how React works.
In React, components aren't rendered recursively, so there's never more than one component's render() on the stack - @gaearon
This results in an unreconstructed tree of components specifying where the problem is stemming from.
The stack-trace from React is actually already parsed, and used to replace the line references on the synthetically generated stack-trace.
The proper behavior, however, would be to not generate a synthetic stack-trace and rely solely on the stack-trace given by React.
We realize this may be a daunting issue, but if you are up to the challenge, we will answer your every question!