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

Migrate away from React.createClass for auth and views/auth. React 16 :D #3363

Merged
merged 1 commit into from
Sep 1, 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
3 changes: 2 additions & 1 deletion src/components/structures/auth/ForgotPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
*/

import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import { _t } from '../../../languageHandler';
import sdk from '../../../index';
Expand All @@ -38,7 +39,7 @@ const PHASE_EMAIL_SENT = 3;
// User has clicked the link in email and completed reset
const PHASE_DONE = 4;

module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'ForgotPassword',

propTypes: {
Expand Down
5 changes: 2 additions & 3 deletions src/components/structures/auth/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

'use strict';

import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import {_t, _td} from '../../../languageHandler';
import sdk from '../../../index';
Expand Down Expand Up @@ -54,7 +53,7 @@ _td("General failure");
/**
* A wire component which glues together login UI components and Login logic
*/
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'Login',

propTypes: {
Expand Down
5 changes: 2 additions & 3 deletions src/components/structures/auth/PostRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

'use strict';

import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import sdk from '../../../index';
import MatrixClientPeg from '../../../MatrixClientPeg';
import { _t } from '../../../languageHandler';

module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'PostRegistration',

propTypes: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/structures/auth/Registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ limitations under the License.
import Matrix from 'matrix-js-sdk';
import Promise from 'bluebird';
import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import sdk from '../../../index';
import { _t, _td } from '../../../languageHandler';
Expand All @@ -40,7 +41,7 @@ const PHASE_REGISTRATION = 1;
// Enable phases for registration
const PHASES_ENABLED = true;

module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'Registration',

propTypes: {
Expand Down
5 changes: 2 additions & 3 deletions src/components/views/auth/AuthFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

'use strict';

import { _t } from '../../../languageHandler';
import React from 'react';
import createReactClass from 'create-react-class';

module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'AuthFooter',

render: function() {
Expand Down
7 changes: 3 additions & 4 deletions src/components/views/auth/AuthHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

'use strict';

const React = require('react');
import React from 'react';
import createReactClass from 'create-react-class';
import sdk from '../../../index';

module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'AuthHeader',

render: function() {
Expand Down
7 changes: 3 additions & 4 deletions src/components/views/auth/AuthPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

'use strict';

const React = require('react');
import React from 'react';
import createReactClass from 'create-react-class';
import sdk from '../../../index';

module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'AuthPage',

render: function() {
Expand Down
5 changes: 2 additions & 3 deletions src/components/views/auth/CaptchaForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

'use strict';

import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import { _t } from '../../../languageHandler';

Expand All @@ -25,7 +24,7 @@ const DIV_ID = 'mx_recaptcha';
/**
* A pure UI component which displays a captcha form.
*/
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'CaptchaForm',

propTypes: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/views/auth/CustomServerDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ limitations under the License.
*/

import React from 'react';
import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler';

module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'CustomServerDialog',

render: function() {
Expand Down
13 changes: 7 additions & 6 deletions src/components/views/auth/InteractiveAuthEntryComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
*/

import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import url from 'url';
import classnames from 'classnames';
Expand Down Expand Up @@ -63,7 +64,7 @@ import SettingsStore from "../../../settings/SettingsStore";
* focus: set the input focus appropriately in the form.
*/

export const PasswordAuthEntry = React.createClass({
export const PasswordAuthEntry = createReactClass({
displayName: 'PasswordAuthEntry',

statics: {
Expand Down Expand Up @@ -162,7 +163,7 @@ export const PasswordAuthEntry = React.createClass({
},
});

export const RecaptchaAuthEntry = React.createClass({
export const RecaptchaAuthEntry = createReactClass({
displayName: 'RecaptchaAuthEntry',

statics: {
Expand Down Expand Up @@ -212,7 +213,7 @@ export const RecaptchaAuthEntry = React.createClass({
},
});

export const TermsAuthEntry = React.createClass({
export const TermsAuthEntry = createReactClass({
displayName: 'TermsAuthEntry',

statics: {
Expand Down Expand Up @@ -351,7 +352,7 @@ export const TermsAuthEntry = React.createClass({
},
});

export const EmailIdentityAuthEntry = React.createClass({
export const EmailIdentityAuthEntry = createReactClass({
displayName: 'EmailIdentityAuthEntry',

statics: {
Expand Down Expand Up @@ -393,7 +394,7 @@ export const EmailIdentityAuthEntry = React.createClass({
},
});

export const MsisdnAuthEntry = React.createClass({
export const MsisdnAuthEntry = createReactClass({
displayName: 'MsisdnAuthEntry',

statics: {
Expand Down Expand Up @@ -540,7 +541,7 @@ export const MsisdnAuthEntry = React.createClass({
},
});

export const FallbackAuthEntry = React.createClass({
export const FallbackAuthEntry = createReactClass({
displayName: 'FallbackAuthEntry',

propTypes: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/views/auth/RegistrationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.
*/

import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import sdk from '../../../index';
import Email from '../../../email';
Expand All @@ -40,7 +41,7 @@ const PASSWORD_MIN_SCORE = 3; // safely unguessable: moderate protection from of
/**
* A pure UI component which displays a registration form.
*/
module.exports = React.createClass({
module.exports = createReactClass({
displayName: 'RegistrationForm',

propTypes: {
Expand Down