From b3ee3b53ce0ba5b3ee8492ef7cc5365d5ff990ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Fri, 28 Oct 2016 17:01:12 +0100 Subject: [PATCH] remove `value` validation in it's redundant since we already require it in propTypes --- ui/src/components/radio-group/index.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/ui/src/components/radio-group/index.js b/ui/src/components/radio-group/index.js index d696b1dd..42c5fdd4 100644 --- a/ui/src/components/radio-group/index.js +++ b/ui/src/components/radio-group/index.js @@ -8,7 +8,6 @@ const first = require('lodash.first'); const isUndefined = require('lodash.isundefined'); const get = require('lodash.get'); -const invariant = require('invariant'); const Item = require('./item'); const find = require('lodash.find'); const classNames = require('classnames'); @@ -27,11 +26,8 @@ const RadioGroup = React.createClass({ getInitialState: function() { return this.getState(this.props); }, - componentWillMount: function() { - return this.checkValues(this.props); - }, componentWillReceiveProps: function(nextProps) { - return this.setState(this.checkValues(nextProps)); + return this.setState(nextProps); }, getState: function(props) { const _children = React.Children.toArray(props.children).filter((child) => { @@ -65,13 +61,6 @@ const RadioGroup = React.createClass({ checked }; }, - checkValues: function(props) { - invariant(React.Children.toArray(props.children).every((child) => { - return (child.type.name !== 'Radio') ? true : !!child.props.value; - }), 'All childs of must have a value property'); - - return props; - }, handleChange: function(key) { return (ev) => { const {