mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
Don't use componentWillReceiveProps in FieldDateRangeInput
This commit is contained in:
parent
3720591dda
commit
5f7ffd737f
2 changed files with 6 additions and 6 deletions
|
|
@ -138,12 +138,12 @@ class DateRangeInputComponent extends Component {
|
|||
this.onFocusChange = this.onFocusChange.bind(this);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
componentDidUpdate(prevProps) {
|
||||
// Update focusedInput in case a new value for it is
|
||||
// passed in the props. This may occur if the focus
|
||||
// is manually set to the date picker.
|
||||
if (nextProps.focusedInput && nextProps.focusedInput !== this.props.focusedInput) {
|
||||
this.setState({ focusedInput: nextProps.focusedInput });
|
||||
if (this.props.focusedInput && this.props.focusedInput !== prevProps.focusedInput) {
|
||||
this.setState({ focusedInput: this.props.focusedInput });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ class FieldDateRangeInputComponent extends Component {
|
|||
this.handleFocus = this.handleFocus.bind(this);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
componentDidUpdate(prevProps) {
|
||||
// Update focusedInput in case a new value for it is
|
||||
// passed in the props. This may occur if the focus
|
||||
// is manually set to the date picker.
|
||||
if (nextProps.focusedInput && nextProps.focusedInput !== this.props.focusedInput) {
|
||||
this.setState({ focusedInput: nextProps.focusedInput });
|
||||
if (this.props.focusedInput && this.props.focusedInput !== prevProps.focusedInput) {
|
||||
this.setState({ focusedInput: this.props.focusedInput });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue