From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Text area and select example

Text area and select example

Hello and welcome back. Let's start off with an example of a text area input. We'll have a same pattern where we are going to bind value and update on the onChange event. Text area example is going to look very similar to the text input. Instead, it is just going to have a text area control. So let's quickly do that. In the application, inside the components folder, I'm going to add another file. We'll call it text-area-example.tsx We'll do rafce. So we have our component. Inside this component, we are going to declare a state. We can do it bio and we can call useState with an empty value. After that, we can provide a class name flex flex call. Inside here, we can have a label, we can add bio data, we can give it a class name. of text sm, font medium and text gray of about 700. After that, we can have our text area. We can do the value for this being bio. The onChange event is going to take an event and we set bio function to the event target value. Also let's give it a class name of…

Contents