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

will not render for React Native 37 #92

Closed
skyride99 opened this issue Nov 21, 2016 · 8 comments
Closed

will not render for React Native 37 #92

skyride99 opened this issue Nov 21, 2016 · 8 comments

Comments

@skyride99
Copy link

It just blows up in render.

@ssomnoremac
Copy link
Contributor

Which version of the picker? 3 or 4? 3 isn't showing up for me.

@skyride99
Copy link
Author

Android, version 4+ of the picker.
Also version 3 does not show up, there is nothing inside the picker.

@ssomnoremac
Copy link
Contributor

ssomnoremac commented Nov 23, 2016

So there is a breaking change to RN36 that has to do with changing flex to flexGrow, you can get it to look like this other issue by changing this on the picker container.
I looked at v4+ and it's working fine. It actually feels a lot better but it's far less customizable. I think it's definitely worth using something that feels better natively. I would try it again and make sure you are using it correctly.

@skyride99
Copy link
Author

I went back to RN 0.32 and 4.10 of the picker

I have something like this:

<Picker
ref={'refCategory'}
style={{height: 300, backgroundColor: '#fff'}}
pickerHeight={300}
showDuration={300}
pickerData={['Resort', 'Dive Shop', 'Vehicle' ]}
pickerCancelBtnText={''}
pickerBtnStyle={{color: '#439FDF'}}
selectedValue={this.state.selectedOption}
onValueChange={(value) => this.changeCategory(value)}
/>
And that will not render.... is there something different in the API for 4?

@shexiaoheng
Copy link
Contributor

Use like this

 import Picker from 'react-native-picker';

    let data = [];
    for(var i=0;i<100;i++){
        data.push(i);
    }

    Picker.init({
        pickerData: data,
        selectedValue: [59],
        onPickerConfirm: data => {
            console.log(data);
        },
        onPickerCancel: data => {
            console.log(data);
        },
        onPickerSelect: data => {
            console.log(data);
        }
    });
    Picker.show();

@ssomnoremac
Copy link
Contributor

I'm pretty sure you're not on 4.10, it's a completely different implementation just like mentioned above

@skyride99
Copy link
Author

ok i got 4.10 working. But how do you have multiple pickers?

import Picker1 from 'react-native-picker';
import Picker2 from 'react-native-picker';

Picker1.init({});
Picker2.init({});

Picker1.show();
Picker2.show();

Is that right?

@shexiaoheng
Copy link
Contributor

Read README.md

rodolphefauquez pushed a commit to Clintal/react-native-picker that referenced this issue Feb 16, 2018
…l request beefe#92)

Added blur in consultationFormStep2Screen

* Added blur in consultationFormStep2Screen

* Added blur to ConsultaionFormStep4Screen

* Replaced onShow to onFocus

* restore cancel button style and rename _blur to _blurAllTextFields

* Added extend onCancel touchable screen by "git+https://github.com/Clintal/mkp-react-native-picker.git#dismiss-modal"
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

3 participants