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

React-Native Typescript, Constructor isn't assigning property

$
0
0

I have a simple TSC class in my React Native App, that has a constructor, every property is set correctly except weight lbs, it returns undefined. Could someone tell me what's going on?

Class Foo{    sets:number;    reps:number;    weight: number;    weightLbs:number;    constructor(_sets:number,_reps:number,_weight:number) {      this.sets=_sets;      this.reps=_reps;      this.weight=_weight;      this.weightLbs = _weight * 2;    }}

I am suspecting the class isn't being properly re-compiled to JS but I am not sure, it seems so weird


Viewing all articles
Browse latest Browse all 6214

Trending Articles



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