-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #464 from BobertForever/css-in-js
Merge from master and React 0.13/ES6 changes
- Loading branch information
Showing
27 changed files
with
438 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
var React = require('react'), | ||
hljs = require('highlight.js'); | ||
|
||
var CodeBlock = React.createClass({ | ||
class CodeBlock extends React.Component { | ||
|
||
componentDidMount: function() { | ||
hljs.highlightBlock(this.getDOMNode()); | ||
}, | ||
constructor() { | ||
super(); | ||
this.componentDidMount = this.componentDidMount.bind(this); | ||
this.componentDidUpdate = this.componentDidUpdate.bind(this); | ||
} | ||
|
||
componentDidMount() { | ||
hljs.highlightBlock(React.findDOMNode(this)); | ||
} | ||
|
||
componentDidUpdate: function(prevProps, prevState) { | ||
hljs.highlightBlock(this.getDOMNode()); | ||
}, | ||
componentDidUpdate(prevProps, prevState) { | ||
hljs.highlightBlock(React.findDOMNode(this)); | ||
} | ||
|
||
render: function() { | ||
render() { | ||
return ( | ||
<pre className="code-block"> | ||
<code>{this.props.children}</code> | ||
</pre> | ||
); | ||
} | ||
|
||
}); | ||
} | ||
|
||
module.exports = CodeBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,4 @@ var ComponentDoc = React.createClass({ | |
|
||
}); | ||
|
||
module.exports = ComponentDoc; | ||
module.exports = ComponentDoc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.