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

Understanding React Native with callback in type

$
0
0

I am new to react ( native) and typescript and do not fully understand what is the correct syntax for the below example from https://www.typescriptlang.org/docs/handbook/2/functions.html Call Signature

it is working in https://www.typescriptlang.org/ but also have warnings

type printFunction = {  name : string,  (a: string) : void}function greeter( fn: printFunction ) {  fn.a("Hello " + fn.name);}function printToConsole(s: string) {  console.log(s);}greeter({name:"Henk", a:printToConsole});

if some one can shine some light it will be appreciated


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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