Skip to content

Commit

Permalink
Improve Danger error message to not blame React
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiebits committed Aug 11, 2014
1 parent f7af58f commit e2ac2f3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/browser/ui/dom/Danger.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ var Danger = {
dangerouslyRenderMarkup: function(markupList) {
invariant(
ExecutionEnvironment.canUseDOM,
'dangerouslyRenderMarkup(...): Cannot render markup in a Worker ' +
'thread. This is likely a bug in the framework. Please report ' +
'immediately.'
'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' +
'thread. Make sure `window` and `document` are available globally ' +
'before requiring React when unit testing or use ' +
'React.renderComponentToString for server rendering.'
);
var nodeName;
var markupByNodeName = {};
Expand Down Expand Up @@ -166,8 +167,9 @@ var Danger = {
invariant(
ExecutionEnvironment.canUseDOM,
'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' +
'worker thread. This is likely a bug in the framework. Please report ' +
'immediately.'
'worker thread. Make sure `window` and `document` are available ' +
'globally before requiring React when unit testing or use ' +
'React.renderComponentToString for server rendering.'
);
invariant(markup, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.');
invariant(
Expand Down

0 comments on commit e2ac2f3

Please sign in to comment.