From the course: Learning React Native

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Creating a form

Creating a form

From the course: Learning React Native

Start my 1-month free trial

Creating a form

- [Instructor] Let's create a small form that users can use to add their own colors to this list. Within our files, under the components folder I'm going to add a new file, called ColorForm.js. Within this file, we'll go ahead and import react from react. We'll also import a style sheet and the view and text components from react native. Next, we'll create the colorform component, so we'll export default function colorform. This is our component, and I'm going to go ahead and return a view and just some placeholder text that says ready. We'll also need a style sheet so down here on line 12 I'll create one using stylesheet.create. We'll add a container style object to our style sheet and actually, before we start adding styles, I want to see this component so I'm going to come over to the app.js file and I'm going to import our colorform component. Next we want to use it so I'll come down here to my app component and…

Contents