Switch to createReactClass: *everything else*. React 16 :D

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-09-06 18:37:43 +01:00
parent 13258132e7
commit b243004a6c
35 changed files with 90 additions and 85 deletions

View file

@ -14,13 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const React = require('react');
import React from 'react';
import PropTypes from 'prop-types';
const MatrixClientPeg = require("../../../MatrixClientPeg");
const sdk = require('../../../index');
import createReactClass from 'create-react-class';
import MatrixClientPeg from "../../../MatrixClientPeg";
import sdk from '../../../index';
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'ChangeAvatar',
propTypes: {
initialAvatarUrl: PropTypes.string,

View file

@ -16,11 +16,12 @@ limitations under the License.
*/
import React from 'react';
import createReactClass from 'create-react-class';
import sdk from '../../../index';
import MatrixClientPeg from '../../../MatrixClientPeg';
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'ChangeDisplayName',
_getDisplayName: async function() {

View file

@ -17,8 +17,9 @@ limitations under the License.
import Field from "../elements/Field";
const React = require('react');
import React from 'react';
import PropTypes from 'prop-types';
import createReactClass from 'create-react-class';
const MatrixClientPeg = require("../../../MatrixClientPeg");
const Modal = require("../../../Modal");
const sdk = require("../../../index");
@ -30,7 +31,7 @@ import { _t } from '../../../languageHandler';
import sessionStore from '../../../stores/SessionStore';
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'ChangePassword',
propTypes: {

View file

@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
const React = require("react");
const Notifier = require("../../../Notifier");
const dis = require("../../../dispatcher");
import React from "react";
import createReactClass from 'create-react-class';
import Notifier from "../../../Notifier";
import dis from "../../../dispatcher";
import { _t } from '../../../languageHandler';
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'EnableNotificationsButton',
componentDidMount: function() {

View file

@ -15,6 +15,7 @@ limitations under the License.
*/
import React from 'react';
import createReactClass from 'create-react-class';
import Promise from 'bluebird';
import sdk from '../../../index';
import { _t } from '../../../languageHandler';
@ -62,7 +63,7 @@ function portLegacyActions(actions) {
}
}
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'Notifications',
phases: {