Skip to content

Instantly share code, notes, and snippets.

@camspiers
camspiers / MathJ.js
Last active December 18, 2015 01:19
/** @jsx React.DOM */
var MathJ = React.createClass({
shouldComponentUpdate: function (nextProps, nextState) {
return this.props.children !== nextProps.children;
},
componentDidMount: function (rootNode) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, rootNode]);
MathJax.Hub.Queue([function () {
rootNode.style.display = 'inline';