Most Beginner React Developers Do This Wrong

Most Beginner React Developers Do This Wrong

Web Dev Simplified

1 год назад

225,543 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@peter9759
@peter9759 - 15.11.2023 13:35

As always great videos I directly jumped to correct filtering method

Ответить
@alimousavi2763
@alimousavi2763 - 14.10.2023 07:14

Best tutorial for search bar thanks❤

Ответить
@PrinceRk_
@PrinceRk_ - 25.09.2023 18:14

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

Ответить
@jwhennink
@jwhennink - 27.08.2023 00:36

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.

Ответить
@abdurrahmanm.el-sayed5561
@abdurrahmanm.el-sayed5561 - 15.08.2023 13:49

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

Ответить
@FilmsSaaveON
@FilmsSaaveON - 06.08.2023 11:16

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

Ответить
@tubewell5222
@tubewell5222 - 28.07.2023 12:58

Great Thankyou

Ответить
@hilaadin2184
@hilaadin2184 - 23.07.2023 02:30

Just what I needed! Thanks!

Ответить
@sopeketiku7659
@sopeketiku7659 - 12.07.2023 14:45

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 - 10.07.2023 19:57

Helpful, thanks

Ответить
@AliBinNaseer
@AliBinNaseer - 02.07.2023 20:12

Do more if these please!

Ответить
@jrm_0749
@jrm_0749 - 22.06.2023 20:21

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.

Ответить
@nahomfikadu
@nahomfikadu - 15.06.2023 17:03

the source code is not clear to see

Ответить
@DisturbedNeo
@DisturbedNeo - 09.06.2023 01:19

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.

Ответить
@sahilsharma1inspirationalTape
@sahilsharma1inspirationalTape - 28.05.2023 13:41

you fool what are you doing

Ответить
@curiousLeafy
@curiousLeafy - 25.05.2023 12:37

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.

Ответить
@billkammermeier
@billkammermeier - 19.05.2023 15:43

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.

Ответить
@JeetPaul
@JeetPaul - 06.05.2023 07:49

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

Ответить
@thilankawijesooriya559
@thilankawijesooriya559 - 30.04.2023 16:58

I'd been using the useState hook to update the "filteredItems" array also..The way I used to do this was updating the state of "filteredItems" array within a useEffect(updates the filteredItems array when the query changes)..But with this method you manipulate the data inside the filteredItems array nicer than my method and It saves a rerender..Thank you for the demonstration ♥

Ответить
@luiza177music
@luiza177music - 17.04.2023 21:04

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?

Ответить
@dem0niker136
@dem0niker136 - 10.04.2023 14:23

Wow! This was so helpful. Will be using this method from now on. Thanks!

Ответить
@najamkhn
@najamkhn - 01.04.2023 18:51

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

Ответить
@joshjha3700
@joshjha3700 - 01.04.2023 02:11

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

Ответить
@CandanggoPlay
@CandanggoPlay - 30.03.2023 21:46

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

Ответить
@iWontFakeIt
@iWontFakeIt - 19.03.2023 21:01

You could've used useCallback() here instead of useMemo()

Ответить
@adtc
@adtc - 19.03.2023 12:09

Instead of typing `return` you could just remove the curly braces, since arrow function without curly brace will just return the value automatically. (Of course, when you define an object with curly braces to return automatically, you need to wrap it with parentheses.)

Ответить
@MarfTaylor
@MarfTaylor - 15.03.2023 00:41

Hello I was wondering would you please share your settings.json file with us please

Ответить
@luzaw4957
@luzaw4957 - 14.03.2023 11:24

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.

Ответить
@gosnooky
@gosnooky - 05.03.2023 05:53

Please stop teaching people to use create-react-app. It is a terrible boilerplate. Vite is where it's at.

Ответить
@kakun7238
@kakun7238 - 01.03.2023 05:30

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

Ответить
@mikhailvasilev5798
@mikhailvasilev5798 - 01.03.2023 00:32

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

Ответить
@dastaanqureshi3468
@dastaanqureshi3468 - 16.02.2023 19:38

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

Ответить
@albirtarsha5370
@albirtarsha5370 - 14.02.2023 21:38

Super content!

Ответить
@singmantkpss
@singmantkpss - 11.02.2023 10:54

like the one react beta doc example

Ответить
@LazarethPrime
@LazarethPrime - 07.02.2023 12:52

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?

Ответить
@ahmedelbougha
@ahmedelbougha - 28.01.2023 12:41

Thank you, Kyle. Great video as usual!

Ответить
@shadowmarkds7958
@shadowmarkds7958 - 08.01.2023 10:40

Cool as always

Ответить
@yuritavares1916
@yuritavares1916 - 05.01.2023 03:34

Your communication skills are impeccable. Great video!!

Ответить
@garybenade
@garybenade - 02.01.2023 12:30

why did you add and use a ref in onSubmit instead of just using e?
e.currentTarget.value will do the same thing without a ref..

Ответить
@auditusich
@auditusich - 01.01.2023 23:03

Use memo is useless in this example.

Ответить
@turantech
@turantech - 31.12.2022 04:55

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.

Ответить
@hafizhzulian_
@hafizhzulian_ - 30.12.2022 12:55

Nice explanation please make a video about edit data in select component

Ответить
@exliveira
@exliveira - 25.12.2022 05:17

why not use CSS?

Ответить
@taylora.buckner5970
@taylora.buckner5970 - 22.12.2022 21:39

I love the amount of effort you put into your videos; thanks for doing so much for the community.

My only critique is I've noticed a trend of relatively lengthy videos (>10 min), that probably could be shortened. Take that for what you will, I still love your content. I have a feeling that shorter content will become more popular :)

Ответить
@pranshushrivastava20
@pranshushrivastava20 - 19.12.2022 19:18

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

Ответить
@st1llsane456
@st1llsane456 - 17.12.2022 23:47

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

Ответить
@takudzwa_gozo
@takudzwa_gozo - 17.12.2022 10:32

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

Ответить