Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar should consider props.disabled in shouldComponentUpdate #258

Closed
Jonathan-Jan opened this issue Dec 21, 2017 · 1 comment
Closed
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@Jonathan-Jan
Copy link
Contributor

Hi,
Calendar should consider props.disabled in shouldComponentUpdate.

Thanks

@cagataycivici cagataycivici self-assigned this Dec 22, 2017
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Dec 22, 2017
@cagataycivici cagataycivici added this to the 1.3.1 milestone Dec 22, 2017
@Jonathan-Jan
Copy link
Contributor Author

Thanks for this commit but I don't really get the correction. This way we can't update the disabled prop at runtime. (when disabled the component will no longer re-render).
Why not just add nextProps.disabled !== this.props.disabled ? like this :

shouldComponentUpdate(nextProps, nextState) { return (nextProps.value !== this.props.value) || (this.state.currentMonth !== nextState.currentMonth) || (this.state.currentYear !== nextState.currentYear) || (this.props.minDate !== nextProps.minDate) || (this.props.maxDate !== nextProps.maxDate) || nextProps.disabled !== this.props.disabled; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants