mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
pre format only compile time errors (#9538)
* pre format only compile time errors
* Style tweak
(cherry picked from commit 70c01963d9)
This commit is contained in:
committed by
Dan Abramov
parent
eaadfb856d
commit
08234e7b32
@@ -219,9 +219,13 @@ var ReactPlayground = React.createClass({
|
||||
eval(compiledCode);
|
||||
}
|
||||
} catch (err) {
|
||||
// Babel errors are preformatted, runtime errors are not.
|
||||
const errorMessage = err._babel ?
|
||||
<pre style={{overflowX: 'auto'}} className="playgroundError">{err.toString()}</pre> :
|
||||
<div className="playgroundError">{err.toString()}</div>;
|
||||
this.setTimeout(function() {
|
||||
ReactDOM.render(
|
||||
<pre style={{overflowX: 'auto'}} className="playgroundError">{err.toString()}</pre>,
|
||||
errorMessage,
|
||||
mountNode
|
||||
);
|
||||
}, 500);
|
||||
|
||||
Reference in New Issue
Block a user