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

Allow optionsFromProps to be passed at init #2

Merged
merged 1 commit into from
Oct 17, 2014

Conversation

sbellity
Copy link
Contributor

The button classes options are not properly set via setOptions otherwise.

The button classes options are not properly set via setOptions otherwise.
@skratchdot
Copy link
Owner

I'm going to pull this in. Were you changing the button class via a prop, and it wasn't updating, or was the "initial" value never working? Something like:

<DateRangePicker cancelClass={this.state.myClass} />

The reason I ask, is because I think the change you made is really working b/c you removed the weird "needToInit" hack I added.

I think the real fix is to stop calling this.setOptionsFromProps() in the render() function, and calling it intelligently via some of the other react lifecycle points like componentWillReceiveProps().

I'll look into this when I get a chance. I'll probably update some libs, and look into making better use of the react lifecycle. Then I'll test, update the package version, and publish...

skratchdot added a commit that referenced this pull request Oct 17, 2014
Allow optionsFromProps to be passed at init
@skratchdot skratchdot merged commit 0d74dcd into skratchdot:master Oct 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants