Merge pull request #3346 from matrix-org/t3chguy/react16_4

Migrate away from React.createClass for async-components. React 16 :D
pull/21833/head
Michael Telatynski 2019-08-26 19:44:57 +01:00 committed by GitHub
commit 0b9f6cf388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -15,12 +15,13 @@ limitations under the License.
*/ */
const React = require("react"); const React = require("react");
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
const sdk = require('../../../index'); const sdk = require('../../../index');
const MatrixClientPeg = require("../../../MatrixClientPeg"); const MatrixClientPeg = require("../../../MatrixClientPeg");
module.exports = React.createClass({ module.exports = createReactClass({
displayName: 'EncryptedEventDialog', displayName: 'EncryptedEventDialog',
propTypes: { propTypes: {

View File

@ -17,6 +17,7 @@ limitations under the License.
import FileSaver from 'file-saver'; import FileSaver from 'file-saver';
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import { MatrixClient } from 'matrix-js-sdk'; import { MatrixClient } from 'matrix-js-sdk';
@ -26,7 +27,7 @@ import sdk from '../../../index';
const PHASE_EDIT = 1; const PHASE_EDIT = 1;
const PHASE_EXPORTING = 2; const PHASE_EXPORTING = 2;
export default React.createClass({ export default createReactClass({
displayName: 'ExportE2eKeysDialog', displayName: 'ExportE2eKeysDialog',
propTypes: { propTypes: {

View File

@ -16,6 +16,7 @@ limitations under the License.
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import createReactClass from 'create-react-class';
import { MatrixClient } from 'matrix-js-sdk'; import { MatrixClient } from 'matrix-js-sdk';
import * as MegolmExportEncryption from '../../../utils/MegolmExportEncryption'; import * as MegolmExportEncryption from '../../../utils/MegolmExportEncryption';
@ -37,7 +38,7 @@ function readFileAsArrayBuffer(file) {
const PHASE_EDIT = 1; const PHASE_EDIT = 1;
const PHASE_IMPORTING = 2; const PHASE_IMPORTING = 2;
export default React.createClass({ export default createReactClass({
displayName: 'ImportE2eKeysDialog', displayName: 'ImportE2eKeysDialog',
propTypes: { propTypes: {

View File

@ -15,6 +15,7 @@ limitations under the License.
*/ */
import React from 'react'; import React from 'react';
import createReactClass from 'create-react-class';
import sdk from '../../../../index'; import sdk from '../../../../index';
import MatrixClientPeg from '../../../../MatrixClientPeg'; import MatrixClientPeg from '../../../../MatrixClientPeg';
import { scorePassword } from '../../../../utils/PasswordScorer'; import { scorePassword } from '../../../../utils/PasswordScorer';
@ -48,7 +49,7 @@ function selectText(target) {
* Walks the user through the process of creating an e2e key backup * Walks the user through the process of creating an e2e key backup
* on the server. * on the server.
*/ */
export default React.createClass({ export default createReactClass({
getInitialState: function() { getInitialState: function() {
return { return {
phase: PHASE_PASSPHRASE, phase: PHASE_PASSPHRASE,