Removed manual calls to React.PropTypes

* Got a warning that a manual call to React.Proptypes won't be supported in production for the next major versions.
* I just removed them for these three components and moved them inside the class definition.
This commit is contained in:
Joel Louzado 2017-04-12 22:12:47 +05:30
parent 22e9f39cca
commit 9b9943bebc
3 changed files with 12 additions and 9 deletions

View file

@ -4,6 +4,10 @@ let Link;
try { Link = require('react-router').Link; } catch(e) {}
export class Button extends React.Component {
propTypes: {
onClick: React.PropTypes.func
}
render () {
const {
label,
@ -27,8 +31,5 @@ export class Button extends React.Component {
onClick={ onClick }>{ label }</button>;
}
}
Button.propTypes = {
onClick: React.PropTypes.func
};
Accounts.ui.Button = Button;

View file

@ -2,6 +2,10 @@ import React from 'react';
import { Accounts } from 'meteor/accounts-base';
export class Field extends React.Component {
propTypes: {
onChange: React.PropTypes.func
}
constructor(props) {
super(props);
this.state = {
@ -68,8 +72,5 @@ export class Field extends React.Component {
) : null;
}
}
Field.propTypes = {
onChange: React.PropTypes.func
};
Accounts.ui.Field = Field;

View file

@ -4,6 +4,10 @@ import { T9n } from 'meteor/softwarerero:accounts-t9n';
import { hasPasswordService } from '../../helpers.js';
export class PasswordOrService extends React.Component {
propTypes: {
oauthServices: React.PropTypes.object
}
constructor(props) {
super(props);
this.state = {
@ -32,8 +36,5 @@ export class PasswordOrService extends React.Component {
return null;
}
}
PasswordOrService.propTypes = {
oauthServices: React.PropTypes.object
};
Accounts.ui.PasswordOrService = PasswordOrService;