Skip to content

Commit

Permalink
Fix bug in ReactPlayground.
Browse files Browse the repository at this point in the history
Bug was introduced by babel@5 update.
I had missed then console output about `className ReferenceError`.

The output of `compiledCode` content with error in console
helped to find quickly where exactly was the error.
  • Loading branch information
AlexKVal committed Apr 22, 2015
1 parent d979355 commit 5549fa5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/src/ReactPlayground.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import classNames from 'classnames';
import * as modClassNames from 'classnames';
import * as modAccordion from '../../src/Accordion';
import * as modAlert from '../../src/Alert';
import * as modBadge from '../../src/Badge';
Expand Down Expand Up @@ -45,6 +45,7 @@ import * as modWell from '../../src/Well';
import {CodeMirror, IS_NODE} from './CodeMirror';
import babel from 'babel-core/browser';

const classNames = modClassNames.default;
/* eslint-disable */
const Accordion = modAccordion.default;
const Alert = modAlert.default;
Expand Down Expand Up @@ -279,8 +280,8 @@ const ReactPlayground = React.createClass({
console.error(e);
}

let compiledCode = this.compileCode();
try {
let compiledCode = this.compileCode();
if (this.props.renderCode) {
React.render(
<CodeMirrorEditor codeText={compiledCode} readOnly={true} />,
Expand All @@ -292,7 +293,7 @@ const ReactPlayground = React.createClass({
/* eslint-enable */
}
} catch (err) {
console.log(err);
console.log(err, compiledCode);
this.setTimeout(() => {
React.render(
<Alert bsStyle='danger'>{err.toString()}</Alert>,
Expand Down

0 comments on commit 5549fa5

Please sign in to comment.