Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Text string must be rendered within a <Text> Component

<View style={styles.container}>
        <Text style={styles.textStyle}> {Math.floor(time/60).toString().padStart(2,"0") + ":" + 
                    (time % 60).toString().padStart(2,"0")} </Text>{" "}
  </View>{" "}
       <View style={styles.containerbtn}>
        <TouchableOpacity style={styles.buttonStyle} onPress={()=>startTimer()}>
          <Text style={styles.buttonText}> Start </Text>{" "}
        </TouchableOpacity>{" "}
        <TouchableOpacity style={styles.buttonStyle}>
          <Text style={styles.buttonText}> Reset </Text>{" "}
        </TouchableOpacity>{" "}
  </View>{" "}

If you look the code it is giving an error but don’t know what is wrong with it.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Hey wherever you have {" "} you need to delete it since its a text and only meant for it to be rendered in Text

<View style={styles.container}>
        <Text style={styles.textStyle}> {Math.floor(time/60).toString().padStart(2,"0") + ":" + 
                    (time % 60).toString().padStart(2,"0")} </Text>
  </View>
       <View style={styles.containerbtn}>
        <TouchableOpacity style={styles.buttonStyle} onPress={()=>startTimer()}>
          <Text style={styles.buttonText}> Start </Text>
        </TouchableOpacity>
        <TouchableOpacity style={styles.buttonStyle}>
          <Text style={styles.buttonText}> Reset </Text>
        </TouchableOpacity>
  </View>

Do lemme know in case of any concerns

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading