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

Support defaultProps in AutoControlledComponent #764

Closed
levithomason opened this issue Oct 28, 2016 · 0 comments · Fixed by #1066
Closed

Support defaultProps in AutoControlledComponent #764

levithomason opened this issue Oct 28, 2016 · 0 comments · Fixed by #1066

Comments

@levithomason
Copy link
Member

levithomason commented Oct 28, 2016

This was fixed for the Accordion but likely exists in other auto controlled components.

From #763:

The defaultActiveIndex is overridden in the Accordion on componentWillMount. This is an edge case, but we need to update the AutoControlledComponent to defer to default props when calling trySetState in componentWillMount.

The real solve here is likely adding static defaultAutoControlledProps. Currently, the AutoControlledComponent tells devs to use trySetState in componentWillMount instead of setting defaults for auto controlled props. This is to prevent the actual defaults from always winning, however, if we had our own auto controlled defaults then we could apply them correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant