diff --git a/package.json b/package.json index 35c6f8625c..9ab17f5573 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "classnames": "^2.1.2", "commonmark": "^0.28.1", "counterpart": "^0.18.0", + "create-react-class": "^15.6.0", "diff-dom": "^4.1.3", "diff-match-patch": "^1.0.4", "emojibase-data": "^4.0.1", diff --git a/src/Modal.js b/src/Modal.js index debfc37011..fd0fdc0501 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -15,11 +15,10 @@ limitations under the License. */ -'use strict'; - -const React = require('react'); -const ReactDOM = require('react-dom'); +import React from 'react'; +import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import createReactClass from 'create-react-class'; import Analytics from './Analytics'; import sdk from './index'; import dis from './dispatcher'; @@ -32,7 +31,7 @@ const STATIC_DIALOG_CONTAINER_ID = "mx_Dialog_StaticContainer"; * Wrap an asynchronous loader function with a react component which shows a * spinner until the real component loads. */ -const AsyncWrapper = React.createClass({ +const AsyncWrapper = createReactClass({ propTypes: { /** A promise which resolves with the real component */ diff --git a/src/Velociraptor.js b/src/Velociraptor.js index d2cae5c2a7..b7a2d7fb40 100644 --- a/src/Velociraptor.js +++ b/src/Velociraptor.js @@ -1,6 +1,7 @@ const React = require('react'); const ReactDom = require('react-dom'); import PropTypes from 'prop-types'; +import createReactClass from 'create-react-class'; const Velocity = require('velocity-animate'); /** @@ -10,7 +11,7 @@ const Velocity = require('velocity-animate'); * from DOM order. This makes it a lot simpler and lighter: if you need fully * automatic positional animation, look at react-shuffle or similar libraries. */ -module.exports = React.createClass({ +module.exports = createReactClass({ displayName: 'Velociraptor', propTypes: {