React Native - State and Props - Mobile Application development
In this article, we will talk about State and Props State React components has a built-in state object. The state is mutable. This designates that the state can be updated in the future. The state is generally initialized in the constructor and then call setState when we want to change it. In this example, we engender a Text component with state data. The content of the Text component will be updated by clicking a button. The event onPress calls the setState, and it updates the state "knfState" text. First, You must set up your local development environment. Follow the below link to set up your local environment. https://www.knowledgefactory.net/2021/01/react-native-environment-setup-create-demo.html After executing the commands mentioned in this link , a folder with a specified name is created with the following contents. In this example, we engender a Text component with state data. The content of the Text component will be updated by clicking a button. The event on