Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Type Script - React Native: the correct way to pass parameters to the NavigationDialog function

$
0
0

What is the correct way to pass the parameters to the NavigationDialog function so that it can be used wherever I want?

In my example I tried to pass the parameters but I think something is wrong with isVisible parameter.

import React, { useState } from 'react';import { Popup } from 'react-native-map-link';import styles from './NavigationDialogStyle';const NavigationDialog = ({ latitude: number, longitude: number, isVisible: boolean }) => {  const [isVisible, setIsVisible] = useState(false);  const options = {    latitude: latitude,    longitude: longitude,    dialogTitle: 'open with',    dialogMessage: 'what app to use ?',    cancelText: 'close,  };  return (<Popup        isVisible={isVisible}        onCancelPressed={() => setIsVisible(false)}        onAppPressed={() => setIsVisible(false)}        onBackButtonPressed={() => setIsVisible(false)}        modalProps={{          animationIn: 'slideInUp',        }}        appsWhiteList={['waze', 'google-maps']}        options={options}        style={{ container: styles.popupStyle }}      />        );}export default NavigationDialog;

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>