Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Progress towards React 16 compatibility #3276

Merged
merged 3 commits into from
Aug 6, 2019
Merged
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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 4 additions & 5 deletions src/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Velociraptor.js
Original file line number Diff line number Diff line change
@@ -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');

/**
Expand All @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/ConfirmUserActionDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export default React.createClass({
onFinished: PropTypes.func.isRequired,
},

defaultProps: {
getDefaultProps: () => ({
danger: false,
askReason: false,
},
}),

componentWillMount: function() {
this._reasonField = null;
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/rooms/AppsDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/rooms/AuxPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ module.exports = React.createClass({
fullHeight: PropTypes.bool,
},

defaultProps: {
getDefaultProps: () => ({
showApps: true,
hideAppsDrawer: false,
},
}),

getInitialState: function() {
return { counters: this._computeCounters() };
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down