(nextProps)
| 47 | } |
| 48 | |
| 49 | componentWillReceiveProps (nextProps) { |
| 50 | let { name, value, formData, itemUnbind } = nextProps; |
| 51 | |
| 52 | if (nextProps.type && nextProps.type !== this.props.type) { |
| 53 | this.valueType = getValueType(nextProps.type); |
| 54 | } |
| 55 | |
| 56 | if (formData) { |
| 57 | value = formData[name]; |
| 58 | |
| 59 | if (this.props.name !== name && itemUnbind) { |
| 60 | itemUnbind(this.id, this.props.name); |
| 61 | this.bindToForm(nextProps, value); |
| 62 | } |
| 63 | |
| 64 | if (value !== this.state.value) { |
| 65 | this.handleChange(value, nextProps); |
| 66 | } |
| 67 | } else { |
| 68 | if (value !== this.props.value && value !== this.state.value) { |
| 69 | this.handleChange(value, nextProps); |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | shouldComponentUpdate (nextProps, nextState) { |
| 75 | return !shallowEqual(nextProps, this.props) || !shallowEqual(this.state, nextState); |
nothing calls this directly
no test coverage detected