From 9b9943bebca678ca70d701f15d30a124c9a30f18 Mon Sep 17 00:00:00 2001 From: Joel Louzado Date: Wed, 12 Apr 2017 22:12:47 +0530 Subject: [PATCH] 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. --- imports/ui/components/Button.jsx | 7 ++++--- imports/ui/components/Field.jsx | 7 ++++--- imports/ui/components/PasswordOrService.jsx | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/imports/ui/components/Button.jsx b/imports/ui/components/Button.jsx index a22198b..eb957eb 100644 --- a/imports/ui/components/Button.jsx +++ b/imports/ui/components/Button.jsx @@ -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.propTypes = { - onClick: React.PropTypes.func -}; Accounts.ui.Button = Button; diff --git a/imports/ui/components/Field.jsx b/imports/ui/components/Field.jsx index 79e0076..a9b66a2 100644 --- a/imports/ui/components/Field.jsx +++ b/imports/ui/components/Field.jsx @@ -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; diff --git a/imports/ui/components/PasswordOrService.jsx b/imports/ui/components/PasswordOrService.jsx index c0cc786..73db093 100644 --- a/imports/ui/components/PasswordOrService.jsx +++ b/imports/ui/components/PasswordOrService.jsx @@ -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;