From 5549fa53be148d533d4e3196ba0647ebb385c61b Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Wed, 22 Apr 2015 20:18:10 +0300 Subject: [PATCH] Fix bug in ReactPlayground. 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. --- docs/src/ReactPlayground.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/src/ReactPlayground.js b/docs/src/ReactPlayground.js index bcc4bacc12..4a0c64cbaa 100644 --- a/docs/src/ReactPlayground.js +++ b/docs/src/ReactPlayground.js @@ -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'; @@ -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; @@ -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( , @@ -292,7 +293,7 @@ const ReactPlayground = React.createClass({ /* eslint-enable */ } } catch (err) { - console.log(err); + console.log(err, compiledCode); this.setTimeout(() => { React.render( {err.toString()},