Closed Malkom closed 4 years ago
hey @Malkom !
just to be sure, did you also at the top level of your app, used my picker this way?
You must also do that in order to get the "menu" to open
import React, { Component } from 'react';
import { View } from 'react-native';
import QuickPicker from 'quick-picker';
class App extends Component {
render() {
return (
<View style={styles.fill}>
<StatusBar />
<SideMenu>
<OtherFancyStuff />
</SideMenu>
<QuickPicker />
</View>
);
}
}
@Malkom oh also I just realized, there seems to be some web packages in your packages.json? Is this also a web project? This picker will only work on mobile react native app and currently has no web support * :)
Also make sure to use 2.x.x if your using RN > 60
Hey @Valiums
Thanks for your answer ;)
I'm using RN 59 and this is a mobile react native app, build with expo.
Do you think that uninstall react-native-web fix the problem ?
Of course, I import Quickpicker on the top of my page ;)
And for the render view, I have this type of code :
<TouchableOpacity style={{marginTop: 20, alignSelf: 'center', borderWidth: 1, borderRadius: 15, height: 30, width: (screenWidth / 1.2 <= 400 ? screenWidth / 1.6 : 300 ), alignItems: 'center', justifyContent: 'center'}} onPress={() => this._opener()}>
<Text style={{fontSize: 15, fontStyle: 'italic', color: (this.state.sport == "Sport" ? '#A4A4A4' : 'black')}}>{this.state.sport}</Text>
</TouchableOpacity>
Seems to be correct ?
@Malkom sorry, what I meant to say is that you need to make sure that somewhere very high in your project (lets say in your App.ts/App.js) you render this component <QuickPicker />
afterward you should be able to call QuickPicker.open(..) anywhere deeper into your project and the menu should then open.
And nah I don't think having react-native-web will cause any issue :)
And yup that seems to be okay!
Hi @Valiums,
So you have right a <QuickPicker />
is missing from the code !! Everything works fine now ;)
Thank you !!
@Malkom no problem good luck with the project :)
Hi,
I'm working on an app build last year by others devs.
Here my package.json :
Unfortunately, the quickpicker menus do not open.
Here is an example of the code:
Any idea ?