Most Beginner React Developers Do This Wrong

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024

Комментарии • 280

  • @merotuts9819
    @merotuts9819 Год назад +173

    Just wasted my whole day yesterday developing a complex people search box at my job. Had to learn all this the hard way 😅 If only you'd posted this a bit sooner 😆

    • @ayoubdouch6975
      @ayoubdouch6975 Год назад +31

      Now, your mind and body will never forget how to make a search box for the rest of your time

    • @yuchuga8341
      @yuchuga8341 Год назад +2

      You can just use react-select library for search input select field. Amazing library

    • @seventeeen29
      @seventeeen29 Год назад +16

      You only wasted a day. Those are rookie numbers in this bracket

    • @Suz4n650
      @Suz4n650 Год назад

      Yeah ! Kyle is a real a hole ! Kidding ofc ! Amazing content !

    • @lickey8919
      @lickey8919 7 месяцев назад

      ...? What lamo

  • @PROJECTJMUSIC
    @PROJECTJMUSIC Год назад +20

    Very helpful! I was actually doing mistake #2 in a recent project, but now I know that I'll have to change that :D

    • @DiestroCorleone
      @DiestroCorleone Год назад +1

      Me too. I was proud of myself, thinking 'I completely dominate forms in React'.
      But Kyle proved me wrong, and I'm thankful for that. Plus, I learned how to use useRef and useMemo (might have to read more about it to fully understand it), but overall, this was a very useful video.

  • @KCrossReal
    @KCrossReal Год назад +287

    One small thing I'd add to the top of the useMemo -> if (!query) return items
    So you don't iterate over the whole list of items if there is no query
    Important for large lists, and also use debouncing in large lists

    • @wasd3108
      @wasd3108 Год назад

      top 10 mistakes a clickbaiter makes when viewer fkin his mom [DO NOT MAKE THIS MISTAKE YOURSELF!]

    • @p33yush
      @p33yush Год назад +9

      true! small but awesome observation

    • @parlor3115
      @parlor3115 Год назад +15

      But then again, you don't want to have large lists as you'll use server side pagination

    • @lauralegerofficial
      @lauralegerofficial Год назад +14

      ​@@parlor3115 It depends, really. Sometimes I will use large lists that are generated on the client side.

    • @theBarracuda_
      @theBarracuda_ Год назад +2

      isn't that redundant with useMemo and depende. array?

  • @jshstuff
    @jshstuff Год назад +4

    My guy’s about to get cancelled for using CRA in 2022 😅

  • @aashish_stanl
    @aashish_stanl 7 месяцев назад +1

    Thanks brother. I am learning react now. Hoping to see me coding like you soon in few years.

  • @und0
    @und0 Год назад +8

    This is a sort of hack but for this specific situation the best way is actually to hide the items using css attribute selectors :P
    then hide them with [data-search*=""] { display: none }
    Obviously this is an over simplification but works for very large lists

    • @nguyenduy-sb4ue
      @nguyenduy-sb4ue Год назад

      What ? That is super mess up

    • @und0
      @und0 Год назад +2

      @@nguyenduy-sb4ue Why would it be messed up? It accomplishes the task without super expensive rerenders or DOM manipulation at all. If you have a list of 10,000 nodes removing those from the DOM tree is extremely expensive especially since it blocks the entire thread. Utilizing the browser's much faster css engine would be tens of times faster

    • @und0
      @und0 Год назад +1

      @@agenticmark no shit sherlock, that's the point. Everyone knows React sucks at rendering large arrays that's why we sometimes have to use "hacks". Or tricks to get around its limitations

  • @jrm_0749
    @jrm_0749 Год назад +6

    Nice video mpan, but to me, it's still not the most efficient way to do it because you're still storing the filtered array. Instead, you can just filter the items array directly in the render() right after the map function. Tell me if I'm missing something.

  • @venzkie89
    @venzkie89 Год назад +3

    I've learned a lot from this guy since I subscribed from this channel. I always looked back from his video list whenever I got stuck from coding. Thank you man.

  • @kwtr
    @kwtr Год назад +5

    I just finished going through the entire React documentation and this is the best video for me to get started on a new project with React! Thanks Kyle

    • @parlor3115
      @parlor3115 Год назад +1

      Now you'll get to build your dream project sooner

    • @siriusFish1
      @siriusFish1 Год назад

      @@parlor3115 lol

  • @anatolydyatlov963
    @anatolydyatlov963 Год назад +48

    I don't know why, but almost every time I watch your "most people do it wrong" videos, I realise that I've been doing the given thing correctly despite the fact that I've learned React on my own through experimentation. Nevertheless, I love watching them just to confirm that there's no better approach. Great work, man, keep it up!

  • @The14Some1
    @The14Some1 Год назад

    4:30 you can extract input value without using ref either by accessing form elements like this: console.log(e.target.elements.inputElementName), or by extracting formData like this: const data = FormData(event.target); console.log(data.get("inputElementName"));
    Both require you to assign the name to your input element, though.

  • @luiza177music
    @luiza177music Год назад +1

    Why do we need a state for query, wouldn't it be simpler to just do the filtering in the onChange event and just grab the value there?

  • @Devanshukoli
    @Devanshukoli Год назад

    Hey! Thanks, Kyle I was confused in my react project about adding filtration and this video solved it perfectly... Thanks really .... You mentioned that you have a free react course right? Now I'm gonna check that as well... I learned a lot...Thanks.

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @visionl.3754
    @visionl.3754 Год назад

    I am really grateful for all the content, thanks Kyle!

  • @curiousLeafy
    @curiousLeafy Год назад

    The third way was what i was doing from the beginning of my react learning. I thought this is how people do it because it made sense if a state changes a component rerenders so storing the input value in state makes your component rerender thus storing the filtered value in a regular variables works just fine.

  • @Valyssi
    @Valyssi Год назад +8

    Key takeaway (which is also stressed in the react docs): don't duplicate state. It is extremely rare for state needing to be duplicated (ie. the same data appearing in different states, or multiple times within the same state). The memoization is a nice addition and good to be aware of, but the docs recommend against preemptive optimizations. If you do optimise, you should keep in mind the memory footprint of that memo and most importantly whether the memo tends to be used (versus a component whose primary state changes involve changing one of the dependencies of the memo)

  • @techwithtaku
    @techwithtaku Год назад +7

    Ever since I started watching this channel, my react skills are improving. thanks man

  • @jwh-e2p
    @jwh-e2p Год назад +2

    Hi, great video. But do you agree that react is only suitable for (very) senior devs, since there are soooo many code ‘design’ mistakes to make? As a project manager with dev skills, I just don’t dare to start a react project due to this complexity for an enterprise client.

  • @st1llsane456
    @st1llsane456 Год назад

    Thank you, I'm doing my first mini-project and it helped me a lot

  • @kellecierion
    @kellecierion Год назад

    A very good video. I love your content, they are simple and easy to understand. I love those contents were it's explained why it is not correct or vice-versa. Best regards

  • @PatrikTheDev
    @PatrikTheDev Год назад +18

    Have you considered switching to Vite in your future tutorials? CRA is no longer the best way to make very lightweight SPAs. You can look up videos on why that’s the case for most uses

    • @jamesyanlan2413
      @jamesyanlan2413 Год назад +3

      I'm a few weeks into react, and I keep seeing youtubers also saying not to use CRA lol. Might have to look into Vite as well. Thanks for the heads up!

    • @Valyssi
      @Valyssi Год назад

      It never was the best way to make lightweight SPA's, it was intended as a learning tool and for that it still serves its purpose (though you'd be right to point out that vite is largely just as beginner-friendly as CRA and can easily serve the same purpose, in addition to being production-friendly). That said, it would be nice for him to at least address vite and the problems with using CRA on any project that isn't just for learning.

    • @ontheruntonowhere
      @ontheruntonowhere Год назад

      His ears must have been burning bc he just released a video about using Vite instead of CRA.

    • @PatrikTheDev
      @PatrikTheDev Год назад

      @@ontheruntonowhere that doesn’t mean his ears are burning or smth, he just realized he was wrong and that’s good

    • @ontheruntonowhere
      @ontheruntonowhere Год назад

      ​@@PatrikTheDev It's a figure of speech dude. Doesn't mean he was wrong.

  • @brandonlange2260
    @brandonlange2260 Год назад +1

    Hey Kyle great video as always, you could possibly show how to do this with async data too.

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @ahmedelbougha
    @ahmedelbougha Год назад

    Thank you, Kyle. Great video as usual!

  • @codenamegrant
    @codenamegrant Год назад +3

    What are your thoughts on using Vite instead of CRA, I find it so much faster to install and run

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @willyhorizont8672
    @willyhorizont8672 Год назад +2

    Correct me if I am wrong. That "items" inside useMemo deps is an array so its render everytime no?

    • @robertcarsten3127
      @robertcarsten3127 Год назад +1

      Because state isn't recreated on each render putting items in a dep array is perfectly fine ( and really the most elegant solution)

  • @grantdoyle1259
    @grantdoyle1259 Год назад +2

    Hey Kyle could you do a video on the new react update that has changes to async await with promises?

  • @developer_hadi
    @developer_hadi Год назад +3

    THIS VIDEO CAME IN THE RIGHT TIME, THANK YOU SO MUCH YOU'RE THE SIMPLEST ON RUclips

  • @osamahussam4351
    @osamahussam4351 Год назад

    thanks a lot !
    We need another video for node js developers

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @tomasburian6550
    @tomasburian6550 5 месяцев назад

    The big problem here is that you're constantly iterating through an array for each change you make. In the real world, you're getting data from a backend upon request, so it's much more effective to just type your query and then make the request for the data so you only receive what you asked for instead of working with large chunks on FE.

  • @thomas-gk9jp
    @thomas-gk9jp Год назад +12

    Thank you, explanations are really good !
    Maybe you could explain a bit more the custom hooks / useEffect concept, which is not the easiest to understand ?!

  • @mikhailvasilev5798
    @mikhailvasilev5798 Год назад +1

    Nice, but you don’t need a ref. You can take input value from the event in the handle submit.

  • @mohammadrafi895
    @mohammadrafi895 Год назад +3

    Thanks for explaining that. I saw the correct way a couple of times but didn't really understand why we need to do it that way.

  • @yonathanhailemelekot5238
    @yonathanhailemelekot5238 Год назад +1

    moral of the story every string includes empty string.

  • @JeetPaul
    @JeetPaul Год назад

    Caching was happening because you forgot to add the key in map element render.

  • @sambhavjain1104
    @sambhavjain1104 Год назад +1

    Hey kyle, can we not directly nest the filter function just before mapping the list, is it a bad approach?
    I’m doing this since 1 year in my company’s project 😅

  • @vapeurdepisse
    @vapeurdepisse Год назад

    Thought using ref like that wasn't right. You're supposed to manage your form fields

  • @martintopolanek448
    @martintopolanek448 Год назад +3

    Quick tip: You don't need to write return if you wrap function body in parentheses.
    So instead doing this:
    filteredItems = items.filter(item => { return item.toLowerCase()... })
    You can do this:
    filteredItems = items.filter(item => (item.toLowerCase()... ))

    • @ridiculousgames365
      @ridiculousgames365 Год назад +2

      You don't even need the parenthesis here because you're returning a single value. This is called implicit return. You would only need parentheses if you were returning an object, for example, items.filter( item => ({ foo: bar }) ).

    • @martintopolanek448
      @martintopolanek448 Год назад

      @@ridiculousgames365 Yeah, you are right.

  • @TonyStark90743
    @TonyStark90743 Год назад +2

    Please make videos on node js and express more. We need updated and advanced topics covered in those videos. Thanks 🙏👍🏻

  • @nabeelahmed7754
    @nabeelahmed7754 Год назад +2

    Super useful.... I was just working on the filters last day.... And i used the first approach.... And now you taught me the correct method.... Thanks buddy ♥️

  • @DisturbedNeo
    @DisturbedNeo Год назад +2

    Another bug with the second naive approach is that if you add a new item, because you're calling "setFilteredItems", the new item will be added to your list even if you have a search term that filters it out. So if your search bar had "on", but you added "three", your list would become "one, three" until you modified the search query again, at which point it would get filtered out correctly.

  • @michaelirwin7258
    @michaelirwin7258 Год назад

    I've been learning react for about a year now. I've just now gotten my first large scale app 99.9% done. I sure wish I had known about useRef 6 months ago :(

  • @PrinceRk_
    @PrinceRk_ Год назад

    I love your video, but I am struggling to add debouncing of the filter ? (using the debounce hook of your courses).
    I see no other way than using useState for filteredProduct, or maybe there is away to use the custom hook useDebouce with useMemo ???
    edit : by using your custom hook usedebounce, i mean, create another one but for useMemo xD not using useefecct behind lol

  • @kakun7238
    @kakun7238 Год назад

    Really informative video also I have a question is it good to just a const like filteredItems because I have also seen people saying let react handle the state so would it be fine to keep the filteredItems inside a useState
    Sorry my English is not that good

  • @keremardicli4013
    @keremardicli4013 Год назад +2

    I hardly can think of use cases for such iten lists. If you do not store them in a database, what good will they do to you?

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @hardwired66
    @hardwired66 Год назад +1

    Thankyou

  • @rhnkashyap
    @rhnkashyap Год назад +1

    After watching WDS tutorials I am able to write React code. Thanks man!!! Very much appreciated.

  • @najamkhn
    @najamkhn Год назад

    Why use state for query when you can useRef() ?

  • @andretura01
    @andretura01 Год назад +2

    Thanks for the video!

  • @yvysunu
    @yvysunu Год назад +1

    This is the first time I have seen this kind of video and realize I do it the right way 😅

    • @robertolanzone
      @robertolanzone Год назад +1

      Same lol this was a pleasing confidence boost for once 😂

  • @NikeshKumar-lt5pz
    @NikeshKumar-lt5pz Год назад +1

    Thanks a lot

  • @aayushgupta8686
    @aayushgupta8686 Год назад +1

    Such a simple use case, but still so many wrong techniques to implement a search bar. Thanks for making such videos

  • @wpxpert98
    @wpxpert98 Год назад +1

    thank you kyler for this video, it's really helpful

  • @pranshushrivastava20
    @pranshushrivastava20 Год назад

    Can you do one on how to implement remote pagination with react

  • @joshjha3700
    @joshjha3700 Год назад

    Hello web dev simplified, can you teach us how to set up and install react fully, in Vs code.

  • @israelruas948
    @israelruas948 Месяц назад

    Man, you are a genius programming - Thank you so much for the tutorial. It helped me a lot.
    a tip for everyone.
    {query ? setFilteredItems.map((item) => { return ("your components and etc") : null } It will display the list only when the user starts typing.

  • @alanhf
    @alanhf Год назад

    Very helpful as always...
    One quick question for anyone who could answer:
    Is it best practice, mandatory or irrelevant split your "fetch code" from your rendering component?!
    Thanks!!!

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

    • @davidmartensson273
      @davidmartensson273 Год назад

      I would say yes. By separating them you can extend them independently like adding caching, retries or multiple sources without touching the rendering component OR switch rendering or render in more than one place or ... there are so many possible reasons you would want to do it :)
      And when you do, you also might want to separate out state from the actual display components, but that is a bit more nuanced.

  • @shadowkage4153
    @shadowkage4153 Год назад +2

    learning React rn in school and i learn more from you than them

    • @EnriqueDominguezProfile
      @EnriqueDominguezProfile Год назад +1

      Just don't use CRA, even if he does. There's Vite now, it's 2022. CRA made sense bc of the polyfills and bc no one wanted to set up a react env and configure webpack by hand. Now it's just a bloated and buggy piece of sh*t.

    • @shadowkage4153
      @shadowkage4153 Год назад

      @@EnriqueDominguezProfile oh cool, thanks! I’ll look into Vite.

  • @vavinashece5158
    @vavinashece5158 6 месяцев назад

    Can't understand if query is " " then why in filter items we are getting all data of item.filter it should return [] ?

  • @Wintersun83
    @Wintersun83 Год назад +1

    Why does he not need the function version anymore at 8:00 ? Why was it needed at all?

    • @robertcarsten3127
      @robertcarsten3127 Год назад

      So in this particular situation the function version was used to get the previous value of the items state variable and then a filter was performed in that function. If your new value of a state is being derived from the previous value of that state you should always use the function version to pipe in the value instead of accessing it directly.
      so do this
      setCount(prevCount => prevCount + 1)
      and not this
      setCount(count + 1)
      and once he had removed the filtering function to it's own slice of state he no longer needed to access the previous version of the items state inside its own setState function so just using the state variable was fine

  • @yetissezgin6931
    @yetissezgin6931 Год назад

    I handle this problem by storing the state of the items in an object in the list. When something is typed, i change the state of the object of the item, it is shown or not.

  • @abidshahriar
    @abidshahriar Год назад

    why not use filter with the query before map like this,
    items.filter(item => item.toLowerCase().includes(query.toLowerCase())).map(..........)

    • @amannan-123
      @amannan-123 Год назад

      Unnecessary overhead while rendering. Makes performance terrible for long lists.

  • @kirarevcrow
    @kirarevcrow Год назад

    Still better have a query request to receive the filtered list from a server and not doing it from the front, it can be very costly in terms of performance when the list is long.

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @FilmsSaaveON
    @FilmsSaaveON Год назад

    no way you just called me naive and bad code writter :c but I learn something, so we cool

  • @changbogo23
    @changbogo23 Год назад +1

    Thank you a lot . Good stuff

  • @khoinguyen-ft2ys
    @khoinguyen-ft2ys Год назад +2

    One thing to notice is that, the cost of recalculate filteredItems is not that much, but the cost of re-render filteredItems into the tree is much more bigger

    • @RandomGuy-jv4vd
      @RandomGuy-jv4vd Год назад

      @@khoinguyen-ft2ys Ahh...the blog post which you cited also addressed the same thing as my link above:
      "Unnecessary re-renders by themselves are not a problem: React is very fast and usually able to deal with them without users noticing anything"
      Therefore, most of the time, it's more likely the issue of slow render rather than Unnecessary re-render.
      Anw, tysm for such an in-depth article, I'm very glad that I learnt something new after all :D

    • @khoinguyen-ft2ys
      @khoinguyen-ft2ys Год назад +1

      @@RandomGuy-jv4vd You're welcome

  • @jetmartin9501
    @jetmartin9501 Год назад +1

    Great video as usual. Is there any reason you are using an uncontrolled form? Facebook recommends use of controlled forms instead of uncontrolled forms. Just curious?

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @arielspalter7425
    @arielspalter7425 Год назад +1

    Fantastic tutorials. Thanks!

  • @ryry6498
    @ryry6498 Год назад +1

    const filteredItems, but its actually not a constant, is it ok to do in React, or am i missing something?

    • @robertcarsten3127
      @robertcarsten3127 Год назад +1

      So think of a react component as just a simple function call, each time the component re-renders it is a brand new function call.
      So every time the component is re-rendered all the code inside the function is re-ran, any plain variables (even constant variables) are re-calculated on each call.
      That was one of the main driving points to the creation of React state and refs, to preserve data between renders (function calls)

    • @robertcarsten3127
      @robertcarsten3127 Год назад

      @@agenticmark I'm not sure what this reply is supposedly to do with my comment.
      Using refs to preserve data across function calls? that is literally what refs are used for.

  • @bass1387
    @bass1387 4 месяца назад

    Stuff for beginners)) Perfect result in the end!

  • @billkammermeier
    @billkammermeier Год назад

    I like your videos, but the clickbait titles into 10 minutes of setup before we actually hear what the topic is is kind of irritating.

  • @nwaguchima2280
    @nwaguchima2280 Год назад +1

    Thank you so much, Kyle, your contents are always excellent, I have learnt so much and am grateful. I am curious though, instead of using a useMemo, why not just have a use effect that filters the items, with items and queries in the dependency array, I think the question is, which is better? because useMemo sure comes with a cost.

    • @fabienbroquard7690
      @fabienbroquard7690 Год назад +1

      useMemo is like a useState with dependencies automaticly triggering it. If you useEffect, you'd need to create a new useState to save the filtered items (if you modify a const of an array set in code it won't work because useEffect runs after the render, it wouldn't render the updated const array)..
      thus with useEffect/useState, 2 re-renders: one setQuery/setItems changes -> triggers -> useEffect -> triggers -> setFilteredList (which by setting a new state triggers a re-render a second time to display the updated filteredList state). Using useMemo will do the same in only one re-render, because it sets the 'returned state of useMemo' before rendering, not after. useEffect runs after the component has re-rendered.

  • @CandanggoPlay
    @CandanggoPlay Год назад

    "Most Beginner React Developers Do This Wrong"
    Using cra to start a project...

  • @mayankjain-901
    @mayankjain-901 4 месяца назад

    How is the approach for adding a bool variable like visible to display filtered content or not .

  • @akshaylokray
    @akshaylokray Год назад

    @Kyle why did we not wrap the search input inside a form?

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

  • @CFXTBogard
    @CFXTBogard Год назад

    but... you said we shouldn't be using RCA... why not vite?

  • @lucienchu9649
    @lucienchu9649 Год назад

    Pretty informative, thx

  • @twixtwix8452
    @twixtwix8452 Год назад

    its crazy to see how ugly reacts code is compared to vue's code, like it's total mess and even vanilla js looks better.

  • @unpluggedaman
    @unpluggedaman Год назад +1

    Super useful

  • @lescobrandon2202
    @lescobrandon2202 Год назад +1

    Good stuff!

  • @dastaan3468
    @dastaan3468 Год назад

    this is weird,can someone tell me why there are items in filteredItem variable if condition is not matched in filter fn?

  • @LazarethPrime
    @LazarethPrime Год назад

    Currently learning React, so apologies if there's something I'm not catching about how useMemo works, but wouldn't this end up using much more memory than just "duplicating" the state, especially if it fires off for every letter typed? Isn't this just hiding that under an abstraction effectively making it harder to reason about if there ever is an issue?

    • @LazarethPrime
      @LazarethPrime Год назад +1

      Answer to myself: okay so useMemo is about persisting results through rerenders when their dependencies haven't changed, so there won't be an unknown size of growing cache of previous calculations, just a persistence of the last one to avoid recalc on every render. It's effectively useState with some magic on top to abstract it away as derived state.
      Learning by asking, and then looking it up 😅

  • @rishiraj2548
    @rishiraj2548 Год назад +1

    👍👍

  • @emmanuelameyaw5686
    @emmanuelameyaw5686 5 месяцев назад

    Hello Kyle I thnk there's another better way

  • @abdurrahmanm.el-sayed5561
    @abdurrahmanm.el-sayed5561 Год назад

    thank you bro, you're awesome!!!!

  • @RodrigoAlvesdeMacedo
    @RodrigoAlvesdeMacedo 7 месяцев назад

    Amazing! I'm learning sooo much with your videos! Thank you!

  • @dannyj7262
    @dannyj7262 Год назад +4

    Does this also work for when getting data from a DB. I've always made a filter method in my backend code. Then when you type in a search box you call the API filter method and get the returned code. I've always thought this a little crazy, as you could be making several API calls.
    This way makes perfect sense if your array is already in state in your react app.
    I've just made an app using redux state management so I presume you can use a similar approach here?

    • @CottidaeSEA
      @CottidaeSEA Год назад

      Debounce the input so you don't trigger on every key press and cache the result from API. The cache rules are set by the API server.
      If no cache headers exist or if it explicitly says not to cache, you can still cache it locally using Redux, sessionStorage or just a JavaScript Map.

  • @alimousavi2763
    @alimousavi2763 11 месяцев назад

    Best tutorial for search bar thanks❤

  • @CottidaeSEA
    @CottidaeSEA Год назад

    The inputRef is also unnecessary. If you name the form inputs you'll be able to access them straight through the event.target, which will be our form in the SubmitEvent.
    For example, if the input is named searchInput, we can access the DOM element by using event.target.searchInput.

  • @enricoantonio3282
    @enricoantonio3282 Год назад +1

    Can someone explain to me shortly, what is the difference between useEffect and useMemo? I'm a beginner in react and still confused about it.

    • @whatsapp176
      @whatsapp176 Год назад

      Helpline 📲📩⬆️
      Questions can come in⬆️

    • @winken2666
      @winken2666 Год назад +1

      useEffect triggers a function if something changes. useMemo just saves all values returned within it, and uses the stored values instead of running a function to figure it out again.

  • @ДаниялКожакметов

    базар жок Кайли!Ырзамын гой

  • @peter9759
    @peter9759 10 месяцев назад

    As always great videos I directly jumped to correct filtering method

  • @luzaw4957
    @luzaw4957 Год назад

    One mistake I've learned is that I continuously fire API or filters items on input change, so, it's better to add debounce function, wait until the typing is finished and fire API or filter.

  • @kursflash
    @kursflash Год назад

    How to use useRef() in TypeScript with current.value?

  • @singmantkpss
    @singmantkpss Год назад

    like the one react beta doc example

  • @turantech
    @turantech Год назад

    You do not need ref to get value from Input. e.target.value is enough. And never set value ref.current.value. You should just say setValue(‘’) as it is controlled input.

  • @lickey8919
    @lickey8919 7 месяцев назад

    Like every other turorial out there, this is nice for small projects for learning react or small scale personal websites. Id like to see a server sided pagination with filters tutorial. I think that would be very useful

  • @malag6358
    @malag6358 4 месяца назад

    its very helpful

  • @kDev7659
    @kDev7659 Год назад

    Hi Kyle, do you mentor those who purchase your courses if they have problems or questions? Like a discord group or something? Love the way you take your lessons but I would really love to have some mentoring as well while I learn React. Thanks

  • @Ram-sc6or
    @Ram-sc6or Год назад

    Helpful, thanks

  • @Flash136
    @Flash136 Год назад

    Man's still running Create React App in 2022 lmao