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

Proptypes function react native Typescript

$
0
0

Hi everybody im making a new app at react native using tsx and i have a question.

Im have three props at screen, one boolean and two functions, my question isthere is a way of to define a proptype function without to use "any" type? using js with "proptypes" i can to use proptypes "function" but i do not have idea of how to make this using typescript

import React from 'react'import { View, StyleSheet, Text, Modal, TouchableOpacity } from 'react-native';import { RNCamera } from 'react-native-camera';interface propTypes {  isVisible : boolean,  scanCallback: any,  OnCloseModal: any}const ScannerModal = ({isVisible, scanCallback, OnCloseModal}: propTypes) => {  if (!isVisible) {    return null  }  const onBarCodeRead = (e : {data : string, type: string}) => {    scanCallback(e.data, e.type)  }  return (      .....  )}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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