From a5e30e0238ebbe4106b7fdeb27a180a59962f74e Mon Sep 17 00:00:00 2001 From: Basant Besra Date: Wed, 21 Jun 2017 00:30:45 +0530 Subject: [PATCH 1/7] Update package.json --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2cc532b..8174575 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,14 @@ "devDependencies": { "babelify": "^7.3.0", "browserify": "^13.1.1", + "create-react-class": "^15.6.0", "eslint": "^3.12.0", "eslint-config-gitbook": "^1.4.0", "gh-pages": "^0.12.0", "http-server": "^0.9.0", - "react": "^15.4.1", - "react-dom": "^15.4.1" + "prop-types": "^15.5.10", + "react": "^15.6.1", + "react-dom": "^15.6.1" }, "dependencies": { "babel-cli": "^6.18.0", From d29316f69b37133807728fa5266f28b4a3641084 Mon Sep 17 00:00:00 2001 From: Basant Besra Date: Wed, 21 Jun 2017 00:32:35 +0530 Subject: [PATCH 2/7] Update node.js --- src/node.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/node.js b/src/node.js index ea4c1e6..956f410 100644 --- a/src/node.js +++ b/src/node.js @@ -1,4 +1,6 @@ const React = require('react'); +const createReactClass = require('create-react-class'); +const PropTypes = require('prop-types'); const process = require('./process'); /** @@ -6,16 +8,7 @@ const process = require('./process'); * @type {ReactClass} */ const MathJaxNode = React.createClass({ - propTypes: { - inline: React.PropTypes.bool, - children: React.PropTypes.node.isRequired, - onRender: React.PropTypes.func - }, - - contextTypes: { - MathJax: React.PropTypes.object - }, - + getDefaultProps() { return { inline: false, @@ -137,4 +130,15 @@ const MathJaxNode = React.createClass({ } }); + +MathJaxNode.propTypes = { + inline: PropTypes.bool, + children: PropTypes.node.isRequired, + onRender: PropTypes.func +}; + +MathJaxNode.contextTypes = { + MathJax: PropTypes.object +}; + module.exports = MathJaxNode; From 4c6231a59641dc2410b148b13617ef75f028d003 Mon Sep 17 00:00:00 2001 From: Basant Besra Date: Wed, 21 Jun 2017 00:34:09 +0530 Subject: [PATCH 3/7] Update context.js --- src/context.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/context.js b/src/context.js index d21afc5..231429e 100644 --- a/src/context.js +++ b/src/context.js @@ -1,5 +1,7 @@ /* global MathJax */ const React = require('react'); +const createReactClass = require('create-react-class'); +const PropTypes = require('prop-types'); const loadScript = require('load-script'); const DEFAULT_SCRIPT = @@ -18,19 +20,7 @@ const DEFAULT_OPTIONS = { * @type {[type]} */ const MathJaxContext = React.createClass({ - propTypes: { - children: React.PropTypes.node.isRequired, - script: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.oneOf([false]) - ]), - options: React.PropTypes.object - }, - - childContextTypes: { - MathJax: React.PropTypes.object - }, - + getDefaultProps() { return { script: DEFAULT_SCRIPT, @@ -75,4 +65,18 @@ const MathJaxContext = React.createClass({ } }); + +MathJaxContext.propTypes = { + children: PropTypes.node.isRequired, + script: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.oneOf([false]) + ]), + options: PropTypes.object +}; + +MathJaxContext.childContextTypes = { + MathJax: PropTypes.object +}; + module.exports = MathJaxContext; From 40bdbc8258d87e5abdcfe1ba062409029caa8813 Mon Sep 17 00:00:00 2001 From: Basant Besra Date: Wed, 21 Jun 2017 00:47:05 +0530 Subject: [PATCH 4/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 56bbffc..4698f7c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # `react-mathjax` +## `(updated with React 15.6.1)` [![NPM version](https://badge.fury.io/js/react-mathjax.svg)](http://badge.fury.io/js/react-mathjax) From 48942dadec87f2f309532483070369ef217be55f Mon Sep 17 00:00:00 2001 From: Basant Besra Date: Wed, 21 Jun 2017 00:47:27 +0530 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4698f7c..7050879 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # `react-mathjax` -## `(updated with React 15.6.1)` +#### (updated with React 15.6.1) [![NPM version](https://badge.fury.io/js/react-mathjax.svg)](http://badge.fury.io/js/react-mathjax) From a57d969bbf6de822df1f1850a0626cb55d827409 Mon Sep 17 00:00:00 2001 From: Basant Besra Date: Wed, 21 Jun 2017 08:27:24 +0530 Subject: [PATCH 6/7] Update node.js --- src/node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.js b/src/node.js index 956f410..439ced4 100644 --- a/src/node.js +++ b/src/node.js @@ -7,7 +7,7 @@ const process = require('./process'); * React component to render maths using mathjax * @type {ReactClass} */ -const MathJaxNode = React.createClass({ +const MathJaxNode = createReactClass({ getDefaultProps() { return { From c0682d245cd570afbdf7b0743992b08450fa96bb Mon Sep 17 00:00:00 2001 From: Basant Besra Date: Wed, 21 Jun 2017 08:27:49 +0530 Subject: [PATCH 7/7] Update context.js --- src/context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.js b/src/context.js index 231429e..71e8c4f 100644 --- a/src/context.js +++ b/src/context.js @@ -19,7 +19,7 @@ const DEFAULT_OPTIONS = { * Context for loading mathjax * @type {[type]} */ -const MathJaxContext = React.createClass({ +const MathJaxContext = createReactClass({ getDefaultProps() { return {