Sign in Go Pro

Build a React Native Application

Setting State in React Native with setState

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson
Autoplay

Up next

Previous

About

Once a user types input into a text box, we want to do something with that input. We'll use setState to change the value of an array of items in the parent component.

Adding the item to that array using setState will automatically re-render the components, and will show the new item in the list.

Summary of Content:

  • Switch the TextInput to a Form from native base
  • Convert the hard-coded items variable to an array in state
  • Using setState to add an item to an array without mutation
  • Using react navigation and goBack to navigate back in the stack

Instructor

Links

Comments

There are no comments on this lesson, start the conversation below ...

>
You need to go PRO to post comments.

Lessons in Build a React Native Application