diff --git a/package.json b/package.json index 43b5f39548..8e1a1fa668 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", @@ -75,7 +76,7 @@ "flux": "2.1.1", "focus-trap-react": "^3.0.5", "fuse.js": "^2.2.0", - "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279", + "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#91e1e566", "gfm.css": "^1.1.1", "glob": "^5.0.14", "highlight.js": "^9.15.8", @@ -96,7 +97,7 @@ "react-addons-css-transition-group": "15.3.2", "react-beautiful-dnd": "^4.0.1", "react-dom": "^15.6.0", - "react-gemini-scrollbar": "github:matrix-org/react-gemini-scrollbar#5e97aef", + "react-gemini-scrollbar": "github:matrix-org/react-gemini-scrollbar#f644523", "resize-observer-polyfill": "^1.5.0", "sanitize-html": "^1.18.4", "slate": "^0.41.2", 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: { diff --git a/src/components/views/dialogs/ConfirmUserActionDialog.js b/src/components/views/dialogs/ConfirmUserActionDialog.js index b65d98d78d..4848e468e9 100644 --- a/src/components/views/dialogs/ConfirmUserActionDialog.js +++ b/src/components/views/dialogs/ConfirmUserActionDialog.js @@ -49,10 +49,10 @@ export default React.createClass({ onFinished: PropTypes.func.isRequired, }, - defaultProps: { + getDefaultProps: () => ({ danger: false, askReason: false, - }, + }), componentWillMount: function() { this._reasonField = null; diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 2976925594..2e9d3e5071 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -44,10 +44,10 @@ module.exports = React.createClass({ hide: PropTypes.bool, // If rendered, should apps drawer be visible }, - defaultProps: { + getDefaultProps: () => ({ showApps: true, hide: false, - }, + }), getInitialState: function() { return { diff --git a/src/components/views/rooms/AuxPanel.js b/src/components/views/rooms/AuxPanel.js index 3c2cf870b8..6cbec30c4d 100644 --- a/src/components/views/rooms/AuxPanel.js +++ b/src/components/views/rooms/AuxPanel.js @@ -57,10 +57,10 @@ module.exports = React.createClass({ fullHeight: PropTypes.bool, }, - defaultProps: { + getDefaultProps: () => ({ showApps: true, hideAppsDrawer: false, - }, + }), getInitialState: function() { return { counters: this._computeCounters() }; diff --git a/yarn.lock b/yarn.lock index 603e9d3471..549b324de3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3493,9 +3493,9 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -"gemini-scrollbar@github:matrix-org/gemini-scrollbar#b302279", gemini-scrollbar@matrix-org/gemini-scrollbar#b302279: +"gemini-scrollbar@github:matrix-org/gemini-scrollbar#91e1e566", gemini-scrollbar@matrix-org/gemini-scrollbar#91e1e566: version "1.4.3" - resolved "https://codeload.github.com/matrix-org/gemini-scrollbar/tar.gz/b302279810d05319ac5ff1bd34910bff32325c7b" + resolved "https://codeload.github.com/matrix-org/gemini-scrollbar/tar.gz/91e1e566fa33324188f278801baf4a79f9f554ab" get-caller-file@^1.0.1: version "1.0.3" @@ -6393,9 +6393,9 @@ react-dom@^16.4.2: prop-types "^15.6.2" scheduler "^0.13.6" -"react-gemini-scrollbar@github:matrix-org/react-gemini-scrollbar#5e97aef": +"react-gemini-scrollbar@github:matrix-org/react-gemini-scrollbar#f644523": version "2.1.5" - resolved "https://codeload.github.com/matrix-org/react-gemini-scrollbar/tar.gz/5e97aef7e034efc8db1431f4b0efe3b26e249ae9" + resolved "https://codeload.github.com/matrix-org/react-gemini-scrollbar/tar.gz/f64452388011d37d8a4427ba769153c30700ab8c" dependencies: gemini-scrollbar matrix-org/gemini-scrollbar#b302279