I have a stack navigator with Button in Appbar.Header for opening modal in file stack.tsx:
export const StackNavigator = () => {return (<Stack.Navigator ...<Appbar.Header><Appbar.Content title={<MaterialCommunityIcons onPress={OPEN_MODAL_FROM_HERE}/> ...</Appbar.Header> ...<Stack.Screen name="Search" component={BottomTabs}/>...)}
BottomTabs Search tab (search.tsx) contains react-native-paper modal:
const SearchScreen = (props) => { const [visible, setVisible] = React.useState(false); const hideModal = () => setVisible(false); const showModal = () => setVisible(true);return (<Provider><FlatList .../><Portal><Modal visible={visible} onDismiss={hideModal}></Modal></Portal></Provider>...)}
How can I do it?