React Course - TypeScript - Forms and Events

preview_player
Показать описание
Learn how to use Forms and Events with TypeScript.

🔗 Connect 🔗
Рекомендации по теме
Комментарии
Автор

The trick of setting up the event handler inline to check the type of event is super useful. I was using the native JS Event type till today and realized the type should be the synthetic events defined by React after watching your video.

PrashanthPuranik
Автор

I searched the whole internet to find this technique that you just showed lol changing the event handler to inline form and finding the proper type to use. Thanks a lot 💖.

tabliqatchi
Автор

You made event type declaration simple Thanks a LOT

roshiniacsah
Автор

Alternatively, you could also use the as a type for the input's onChange handler function. Respectively for the form's onSubmit handler.

thexpand
Автор

Thank you very much. I have been looking for such an example for a long time. Either a library is used or Javascript. I am almost desperate. For me as a beginner in React, clean examples are important. Thank you

TauwinKul
Автор

I have a question ? Ok, i know you have to define a interface when using useState() hook, ... but why Typescript doesn´t give you an error for the "const defaultFormData = { title:'', body:'' } " ?, .. that´s confusing my brain.. lolll...sorry im just curious why ?

romimaximus
Автор

Wish you had some examples for other field types in your formData, currently struggling with an inputnumber field for the past 30 minutes.

patrickmisner
Автор

What if you have an input type file in the form, how do you handle it?

hichamamroussi
Автор

Just use 4 mins to explain the details that people need more than an hour.

hin