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

Make this a controlled component #5

Open
esamattis opened this issue Jan 15, 2016 · 2 comments
Open

Make this a controlled component #5

esamattis opened this issue Jan 15, 2016 · 2 comments

Comments

@esamattis
Copy link
Contributor

I'm keeping my state in Redux store so having extra state inside this component causes weird bugs.

I think this should work like controlled/uncontrolled inputs in standard React: https://facebook.github.io/react/docs/forms.html

Also the prop index is confusing I think it should be renamed to initialIndex and index be used for the controlled behaviour.

@cgarvis
Copy link
Contributor

cgarvis commented Jan 15, 2016

I don't think this can every be fully stateless do to Animated.View and PanResponder. We should definitely either rename prop or add in componentWillReceiveProp. Do you want to wipe up a concept of a controlled component?

@esamattis
Copy link
Contributor Author

I will send you a pull request soon for this. And true, you're right it cannot be fully stateless. Animations must have state but the index doesn't which is what actually matters.

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

Successfully merging a pull request may close this issue.

2 participants