React Native: Update Text Inside a Variable
I have a variable that contains a text element. This text element has to be a variable and I need to change the text displayed. This is my code: import React, {Component} from 'react'; import { Button, Platform, StyleSheet, Text, View } from 'react-native'; type Props = {}; export default class App extends Component<Props> { // Initializes testval and testItem. constructor(props) { super(props); this.state = { testval:0, } this.testItem = <Text style={{ position:'absolute', left:50, top:200, backgroundColor:'white', }} > Value: {this.state.testval} </Text> } // Call `UpdateTest` after some tim
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.