Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"eslint-config-gitbook": "^1.4.0",
"gh-pages": "^0.12.0",
"http-server": "^0.9.0",
"prop-types": "^15.6.0",
"react": "^15.4.1",
"react-dom": "^15.4.1"
},
Expand Down
13 changes: 7 additions & 6 deletions src/context.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* global MathJax */
const React = require('react');
const PropTypes = require('prop-types');
const loadScript = require('load-script');

const DEFAULT_SCRIPT =
Expand All @@ -19,16 +20,16 @@ const DEFAULT_OPTIONS = {
*/
const MathJaxContext = React.createClass({
propTypes: {
children: React.PropTypes.node.isRequired,
script: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.oneOf([false])
children: PropTypes.node.isRequired,
script: PropTypes.oneOfType([
PropTypes.string,
PropTypes.oneOf([false])
]),
options: React.PropTypes.object
options: PropTypes.object
},

childContextTypes: {
MathJax: React.PropTypes.object
MathJax: PropTypes.object
},

getDefaultProps() {
Expand Down
9 changes: 5 additions & 4 deletions src/node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const React = require('react');
const PropTypes = require('prop-types');
const process = require('./process');

/**
Expand All @@ -7,13 +8,13 @@ const process = require('./process');
*/
const MathJaxNode = React.createClass({
propTypes: {
inline: React.PropTypes.bool,
children: React.PropTypes.node.isRequired,
onRender: React.PropTypes.func
inline: PropTypes.bool,
children: PropTypes.node.isRequired,
onRender: PropTypes.func
},

contextTypes: {
MathJax: React.PropTypes.object
MathJax: PropTypes.object
},

getDefaultProps() {
Expand Down
Loading