I am new on this forum and new in React Native. Could someone write me a piece of code to create form elements (image, toggle switch) based on json.
My JSON look like
[{ "consumer": "S1", "status": "False"},{ "consumer": "S2", "status": "False"},{"consumer": "S3", "status": "True"},{ "consumer": "S4", "status": "False"},{ "consumer": "S7", "status": "False"}]
I would like to get i for each mode something like:
<View style={{width: '30%', height: 200}}>
<Image
source={
require('../assets/images/s1.png') //sx
}
style={styles.welcomeImage}
/>
</View>
<View style={{width: '30%', height: 200}}>
<Switch
//here get status of s1..s8
</View>