-
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
App.js
here i pass data everything fine over here
onPress={() => { setbmi("BMI = " + chnages(weigh, weightUnit, heigh, heightUnit)); navigation.navigate('Calculate',{ bmi:bmi }) }}
Calculate.js
`import { StyleSheet, Text, View} from 'react-native'
import React from 'react'
import RNSpeedometer from 'react-native-speedometer'
const Calculate = ({route, navigation}) => {
const { bmi } = route.params;
alert(bmi)
const [ bmiValue, setBmiValue ] = React.useState();
React.useEffect((bmi)=>{
setBmiValue(bmi)
},[])
return (
<View> `
### //Here i got the value
<Text style={{justifyContent:'center',alignItems:'center',color:'#000'}}>Bmi Is {JSON.stringify(bmi)}</Text>
but i did not get value on speedometer
<RNSpeedometer value={bmi} size={200}
minValue = {0}
maxValue = {50}
allowedDecimals = {10}
labels={
[
{
name: 'You are Underweight',
labelColor : 'pink',
activeBarColor : 'red'
},
{
name: 'You are Healthy',
labelColor : 'green',
activeBarColor : 'red'
},
{
name: 'You are Overweight',
labelColor : 'orange',
activeBarColor : 'red'
},
{
name: 'You are Obese',
labelColor : 'red',
activeBarColor : 'red'
},
{
name: 'You are Severe Obese',
labelColor : 'red',
activeBarColor : 'red'
}
]
}
/>
</View>
)
}
export default Calculate
const styles = StyleSheet.create({})`
Metadata
Metadata
Assignees
Labels
No labels