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 .togglePicker function public #35

Closed
rdebokx opened this issue Jul 25, 2016 · 2 comments
Closed

make .togglePicker function public #35

rdebokx opened this issue Jul 25, 2016 · 2 comments

Comments

@rdebokx
Copy link
Contributor

rdebokx commented Jul 25, 2016

As part of the user experience, I want to be able to close picker modals programmatically when the user selects the next field in the form.
It seems that inside the PickerComponent, the _togglePicker function (https://github.com/MichaelCereda/react-native-form-generator/blob/master/src/lib/PickerComponent.ios.js#L53) does exactly this, but it's not accessible from outside the class.

Would it be possible to make this method publicly accessible?

@MichaelCereda
Copy link
Owner

mm... it's possible but it's actually an antipattern.
the react-way should be using the onChange function to set a prop on the component.

@MichaelCereda
Copy link
Owner

If you check the example you will notice that is possible to change the behavior of one field based on the value of another.

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

No branches or pull requests

2 participants