Todo List in ReactJS using TypeScript Tutorial

Ғылым және технология

Best Tech Resume Template: papermoontech.com/pmcsrtk/pedro
Use code: PEDRO for 20% off ^
My other TypeScript Video: • TypeScript Tutorial Fo...
Code: github.com/machadop1407/TodoL...
In this video I will teach you guys how to code a todo list in react using typescript. We use the typescript template to generate the application.
-
🚀 Learn ReactJS By Building 6 Projects: codedamn.com/learn/reactjs-pr...
💻 PedroTech Discord: / discord
-
Social
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Website: machadopedro.com
Twitter: / pedrotech_
Linkedin: / machadop1407
Instagram: / _pedro.machado_
Github: github.com/machadop1407
Email: machadop1407@gmail.com
Equipments I Use:
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
🌟 Algorithm Book To Pass Coding Interviews: amzn.to/2Z2CirS
🌟 Microphone: amzn.to/2MKAm4V
🌟 Keyboard: amzn.to/3d0QauN
🌟 HD Webcam: amzn.to/3tMpJPD
🌟 Room LED Lights: amzn.to/3a5mFGp
0:00 Intro & Project Overview
1:34 Project Setup (using Create React App)
5:09 App Component - Component Type & JSX markup
8:23 Adding & explaining CSS snippets
11:52 Setting up state - useState in TypeScript
14:00 Change handler - track user input
18:43 Click handler - Adding a task to 'todoList' state
19:45 -- defining and setting the Type of 'todoList' using an interface
23:50 -- clearing inputs after adding new task
24:54 Working with components - creating TodoTask - represents a single todo task
27:17 -- accepting component props
29:58 -- writing markup (JSX/TSX) & styles for TodoTask component
33:08 Complete/delete task functionality in App.tsx
36:52 Testing final app
37:43 Outro
Tags:
- TodoList
- Fetch
- ReactJS Tutorial
- ReactJS and MySQL
- NodeJS Tutorial
- API Tutorial

Пікірлер: 115

  • @liondepierre
    @liondepierre Жыл бұрын

    I've seen a lot of tutorials but this is by far the most down to earth tutorial I've seen. Thank you!!

  • @johneiler4051
    @johneiler40512 жыл бұрын

    Great video! Just a note, if using FC or React.FC for a component like the one at 28:30, you will write "" next to FC/React.FC, instead of ":Props" next to the props object parameter.

  • @sleepyadults
    @sleepyadults2 жыл бұрын

    Nice, when you are importing the functional component structure.. you could do rafce instead of rfce. It will generate the arrow function syntax straight away.

  • @oo5z263
    @oo5z2632 жыл бұрын

    Your explanation is so clear and direct! Thanks a lot:)

  • @wiliansilvadeoliveira774
    @wiliansilvadeoliveira7742 жыл бұрын

    Pedro, estou tão feliz em achar seu canal, seu inglês é tão bom e calmo, o conteúdo é muito útil.

  • @Shakeel714
    @Shakeel7143 жыл бұрын

    Thanks so much bro. Learned so much about React basics and Typescript. Your other tutorials are also very good. You explain complex topics very nicely. Wish your channel grow exponentially.

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    THank you for your kind words! I am really happy that I was able to help you learn! I have really high hopes for the channel, but for now im just enjoying the journey!

  • @vargasbj
    @vargasbj Жыл бұрын

    Oh wow Pedro . Yeah is very simple to-do but you did a master-peace You never went to deep if it was not necessarily but when it was you dogged in perfectly when clear explanations. I am old person but recently start to React and wow this really helped me Congrats !!!

  • @HR-pz7ts
    @HR-pz7ts5 ай бұрын

    Really well done. Thank you for sharing. I have a good understanding of all except the key part which I think I will get comfortable with in the future.

  • @deepakjangid3872
    @deepakjangid38722 жыл бұрын

    Thanks for the video, the explanation was very clear! 🥁

  • @denisjunior1086
    @denisjunior10862 жыл бұрын

    great video man! You're helping me a lot with your videos.

  • @daromacs
    @daromacs2 жыл бұрын

    subscribed man, a great job and effort from you doing this videos :) thanks

  • @amt3025
    @amt3025 Жыл бұрын

    Really good tutorial, well done. On a side note, at 34:23 if you filter by task name and there are 2 tasks with the same name it will delete them both. Instead, you can filter by key/index. In real-life applications usually, data that comes from some DB will always have pk/id. In this case, we use the pk/id of the object to define the key of the row and to delete the task object from our state.

  • @timuramiraliev7452

    @timuramiraliev7452

    Жыл бұрын

    thank you man)

  • @eriklamela4321

    @eriklamela4321

    Жыл бұрын

    you might as well do a hash map for all todos, not to traverse the whole list when deleting

  • @mrugamajmudar5433
    @mrugamajmudar54332 жыл бұрын

    Thank you once again! this is really helpful

  • @pedrohelias4689
    @pedrohelias46892 жыл бұрын

    Valeu Pedrão, vídeo ajudou bastante!

  • @steven7936
    @steven79363 жыл бұрын

    Thank you for this video, I really leveled up my typesript!!!

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Glad it was helpful!

  • @Pedro21Torres
    @Pedro21Torres3 жыл бұрын

    Thank you Pedro, you are so good explaining and everything is so clear. Your channel is helping a lot of people for sure!

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Happy to hear that! I love the support I receive :)

  • @vedantthombare1028

    @vedantthombare1028

    2 жыл бұрын

    Lol a Pedro helped another Pedro 😂

  • @ThColinPereira
    @ThColinPereira3 жыл бұрын

    absolute banger! thanks for the amazing content as always pedro

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    thank you so much! you have no idea how much this means to me!

  • @k303k
    @k303k8 ай бұрын

    You are my best programming teacher!

  • 2 жыл бұрын

    Great!! Straightforward intro to ReactJs - TypeScript👌

  • @amritamatta
    @amritamatta2 жыл бұрын

    very well explained ..excellent job

  • @matkl55
    @matkl552 жыл бұрын

    Quando comecei o video pensei: "esse cara so pode ser brasileiro" (por causa do sotaque kkkk) quando eu vi o nome do canal PedroTech dai eu tive ctz que vc era brasileiro. Parabens pelo trabalho mano

  • @muhammadhamza5296
    @muhammadhamza52963 жыл бұрын

    Oh man u are amazing I just started to learn typescript yestday

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Hahaha thank you! I am glad i could help! If you want i have a video as well teaching how to transition from javascript to typescript! Link is in the description!

  • @ozzyfromspace
    @ozzyfromspace2 жыл бұрын

    Pedro, you're a friggin lifesaver! Thank you for making this video! Petition to make literally everything tomato red 😂🎊❤️☮️🏆 Keep up the excellent work bro

  • @Julian-oy7dy
    @Julian-oy7dy3 жыл бұрын

    This is a very informative video. I saw it very well. It would be great if there was a video that implements master details with the ts-react-dbms-bootstrap skill.

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Thank you for watching! Yeah i can definitely add that to my list of future videos!

  • @netsaichiyaka9469
    @netsaichiyaka9469 Жыл бұрын

    This is a very informative video. I saw it very well.

  • @Ctrl_Alt_Elite
    @Ctrl_Alt_Elite2 жыл бұрын

    0:00 Intro & Project Overview 1:34 Project Setup (using Create React App) 5:09 App Component - Component Type & JSX markup 8:23 Adding & explaining CSS snippets 11:52 Setting up state - useState in TypeScript 14:00 Change handler - track user input 18:43 Click handler - Adding a task to 'todoList' state 19:45 -- defining and setting the Type of 'todoList' using an interface 23:50 -- clearing inputs after adding new task 24:54 Working with components - creating TodoTask - represents a single todo task 27:17 -- accepting component props 29:58 -- writing markup (JSX/TSX) & styles for TodoTask component 33:08 Complete/delete task functionality in App.tsx 36:52 Testing final app 37:43 Outro

  • @PedroTechnologies

    @PedroTechnologies

    2 жыл бұрын

    Wow! Thank you so much for the timestamps, really appreciate u doing this! WIll add it to the video :)

  • @Ctrl_Alt_Elite

    @Ctrl_Alt_Elite

    2 жыл бұрын

    @@PedroTechnologies KZread gave me the notification 5 years later lol. No problem, keep up the great work!

  • @prasanthmanimaran5158
    @prasanthmanimaran51583 жыл бұрын

    Thank you so much for this, brother.

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Glad you liked it!

  • @nxxdev7926
    @nxxdev79262 жыл бұрын

    if you dont have "YARN" you can ** execute npx create-react-app my-app --template typescript **

  • @NehaKumari-dr7gs
    @NehaKumari-dr7gs3 жыл бұрын

    Thanks for making this in typescript :)

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Thank you for watching!

  • @JoDeUK
    @JoDeUK3 жыл бұрын

    Thanks for this tutorial !💚

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    You’re welcome 😊

  • @valentinaotocan5692
    @valentinaotocan5692 Жыл бұрын

    Please, more video like this :D. Typescript & React.js 😊

  • @yulduz2506
    @yulduz25066 ай бұрын

    very helpful thank you very much

  • @rohan1765
    @rohan17653 жыл бұрын

    Thank you so much , it helped alot

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Glad it helped!

  • @user-pc4eg6rz2m
    @user-pc4eg6rz2m2 жыл бұрын

    Thank you bro!

  • @naveenkumaravelmurugaian4891
    @naveenkumaravelmurugaian48913 жыл бұрын

    Perfect video for react using TS!

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Glad you think so!

  • @Noppepoppe
    @Noppepoppe Жыл бұрын

    Really good video!

  • @user-nf1ww4iq8g
    @user-nf1ww4iq8g Жыл бұрын

    Thanks master!!!!

  • @DBDrumss
    @DBDrumss3 жыл бұрын

    Good job! An incredible and very useful tutorial, I have a question with the "completeTask" function, if two tasks have the same name and you filter the task with that function, the two tasks would be deleted, right?

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Thank you! Yeah if they have the same name it would delete both, ideally you could add an id for each task and filter by id. I didn't do that so I wouldn't overcomplicate the video!

  • @DBDrumss

    @DBDrumss

    3 жыл бұрын

    @@PedroTechnologies Great, it's just what I thought, right now I'm trying to make one on my own, could you tell me what extra features I could add to the app as a practice, and challenge Thanks!

  • @ivgadev
    @ivgadev3 жыл бұрын

    Good tutorial man. I recently discovered you and have a great updated content. Can I ask you why yo use :FC in App arrow function but not in a component? Thank you

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Thank you! Really appreciate the support! There are two ways of defining props to components in typescript, one of them is by making it a React.FC component and passing the prop interface like this: and there is the other way which is how i did in the video. I wanted to show both ways but accidentally forgot to explain the first one. Sorry about that, you can write components in both ways, I recommend the second one without the React.FC

  • @ivgadev

    @ivgadev

    3 жыл бұрын

    @@PedroTechnologies Thank you very much for your quick response. I'm watching video after video right now, if you get a lot of views it's my fault lmao. Seriously, good content, updated and with good practices, just what I needed, keep it up! :)

  • @TheNamesJT
    @TheNamesJT3 жыл бұрын

    you have really good tutorials happy i stumbled across your channel. could you make a tutorial for a desktop app using any js framework like electron, nw,js or any other one you want. Also, could you make a video on client data saving aka no database no server this would be more plausible with desktop app creation since people can download the app and data can be stored and saved on clients computer. I just don't know how to do this and have looked on google about it no real tutorial or course that covers this.

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    I have prior experience with electron (i also have a video on it), so I can definitely make a video teaching how to create a simple electron app and save data!

  • @arccoder6181
    @arccoder61813 жыл бұрын

    Which extension you use for showing warnings and errors?

  • @mofe620
    @mofe620 Жыл бұрын

    Thanks a lot

  • @sonamohialdin3376
    @sonamohialdin33762 жыл бұрын

    Very useful tutorial

  • @lydiahkariuki-q7n
    @lydiahkariuki-q7n8 күн бұрын

    Great Job

  • @pelosmeusolhos938
    @pelosmeusolhos9383 жыл бұрын

    thank you!

  • @perfectigbadumhe113
    @perfectigbadumhe1133 жыл бұрын

    cool tutorial learnt a lot can you make CRUD react project using typescript redux, axios and styled component

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Great suggestion! I can definitely do it!

  • @usmankhokhar4569
    @usmankhokhar45692 ай бұрын

    Great Video.

  • @alques-dias
    @alques-dias2 жыл бұрын

    Acabei de conhecer o canal, sensacional seu conteúdo.

  • @hawks2271
    @hawks2271 Жыл бұрын

    Thanks 🇧🇷

  • @damilolaezekiel4331
    @damilolaezekiel43312 жыл бұрын

    How to I get to validate the inputs i.e If the input fields are empty, it should return an error beneath the input like input fields are required However, I really learnt alot from the video thank you so much

  • @ariefsetiawan8445
    @ariefsetiawan84453 жыл бұрын

    nice, go ahead dude💻

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Thanks ✌

  • @angelv2485
    @angelv24853 жыл бұрын

    really helpful

  • @PeriklesPeriklesoglu
    @PeriklesPeriklesoglu5 ай бұрын

    thank you

  • @lautaro17
    @lautaro172 жыл бұрын

    Good video bro! new subscriber 😄

  • @PedroTechnologies

    @PedroTechnologies

    2 жыл бұрын

    Thanks for the sub!

  • @mitch1668
    @mitch16685 ай бұрын

    Pedro, hope all is well. Curious, why did you use interface instead of type? Do you typically use interface?

  • @siroojuddinapendi6213
    @siroojuddinapendi6213 Жыл бұрын

    Great!!!

  • @kaal_bhairav_1835
    @kaal_bhairav_1835 Жыл бұрын

    Bro, how can i implement map() function in the component rather than index.tsx page. I am trying to pass whole object array as props in the component but getting type error. Please explain me if you know the solution , any help is appreciated ❤️

  • @Pareshbpatel
    @Pareshbpatel Жыл бұрын

    Excellent demo of using TS in React. Thanks, Pedro {2023-04-13}

  • @MarcosEsqueda
    @MarcosEsqueda3 жыл бұрын

    Hi! Pedro. I want to make PR! Add an additional validation if a task is empty. Could I do it?

  • @alasassi960
    @alasassi960 Жыл бұрын

    I have tried this with context api and i find it difficult to use it especially when I put functions to it

  • @padcom
    @padcom2 жыл бұрын

    Thanks for the tutorial. It's been fun to watch. One thing though, and I can't fathom why it shows up in tutorials like that over and over and over again. DRY. Why do people repeat themselves so many times. task.taskName (why not just task.name?) ITask? Does it really matter that it is an interface? Why not just Task? Same thing with naming folders and files (totally not in your tutorial but comes time and time again in others) like components/todo/TodoEditor.tsx instead of components/todo/Editor.tsx.

  • @sevdaamini9430
    @sevdaamini94302 жыл бұрын

    Isn't it create-react-app? Mine didn't work with the separate Create :)

  • @LucasRodrigues-ze3yd
    @LucasRodrigues-ze3yd3 жыл бұрын

    Wouldn't be enough setting the prop in TodoTask as below? const TodoTask = (task: ITask) => { ... } Anyway, thanks for the video! Ur channel is awesome!

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Hey, so it depends because I don't think it would work for multiple props. The standard way is creating an interface and restructuring it like in the video. This confused me a lot in the beginning, but it makes sense cause it allows for more organized code.

  • @Shin-jj3qt
    @Shin-jj3qt Жыл бұрын

    No update function??

  • @abdusamadweb9812
    @abdusamadweb9812 Жыл бұрын

    how to create with npm ???

  • @rohan1765
    @rohan17653 жыл бұрын

    In the components which receives props if we specify component type as FC it gives error.

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    When you use the FC, props are passed differently!

  • @rohan1765

    @rohan1765

    3 жыл бұрын

    @@PedroTechnologies got it in the angular brackets next to it , solved , thanks 👍🏻

  • @JJ-ot3ps
    @JJ-ot3ps2 жыл бұрын

    hey Pedro, I saw link usually is created like the following code in real life project typecripts, but it is a bit confusing, can you explain it a bit more in your video? import NextLink, { LinkProps as NextLinkProps } from 'next/link'; const Link: React.FC = ({ href, children, ...props }) => { return ( {children} ); }; export default Link;

  • @umerfarooq3121
    @umerfarooq31213 жыл бұрын

    Do this same with js as well. Thank you

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    I might make one! THank you for watching!

  • @mansilaad2062
    @mansilaad20623 жыл бұрын

    Nice.. Plz make video on angular

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Ive never actually used Angular before, sorry about that!

  • @mansilaad2062

    @mansilaad2062

    3 жыл бұрын

    @@PedroTechnologies ok np:)

  • @shivshankar654
    @shivshankar6542 жыл бұрын

    bro do the crud in typescript and context using react js

  • @ionuttrif8378
    @ionuttrif83782 жыл бұрын

    How can I use the localStorage to keep the list intact between renders?

  • @theundergroundsm

    @theundergroundsm

    2 жыл бұрын

    localStorage.setItem("todolist", JSON.stringify(todoListSate)) // to set the todoState in your localStorage JSON.parse(localStorage.getItem("todolist")) // to get the todoState from your local storage

  • @shaheerarain1026
    @shaheerarain1026 Жыл бұрын

    Please make a video how to import images in react using typescript. Please...............

  • @imusikproduction9069
    @imusikproduction90693 жыл бұрын

    Super Like this video

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Thank you!

  • @parthapaul1249
    @parthapaul12492 жыл бұрын

    KIndly make a mern series with TS

  • @nested9301
    @nested9301 Жыл бұрын

    Why not a class for describing the actual Todo entity

  • @Sozick_
    @Sozick_3 жыл бұрын

    Liked and subbed :-)

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    Awesome thank you!

  • @mohammedbalousha9467
    @mohammedbalousha9467 Жыл бұрын

    Thank you so much for your effort, and I think making your videos shorter, will be nice

  • @BilalKas
    @BilalKas2 жыл бұрын

    25:30

  • @alexandre-ob1nf
    @alexandre-ob1nf3 жыл бұрын

    Bom inglês, nem parece br

  • @PedroTechnologies

    @PedroTechnologies

    3 жыл бұрын

    kkkkkkk obrigado!

  • @maikyroger636
    @maikyroger6362 жыл бұрын

    you said no time wasting whit css... and then talked about it for almost half the video. lol

  • @lucianlsd3274
    @lucianlsd327411 ай бұрын

    Most confusing props explanation in the history of ts props explanations; overall lacking teaching conduct

Келесі