PLEASE Stop Doing Conditional Rendering Like This...

PLEASE Stop Doing Conditional Rendering Like This...

TomDoesTech

2 года назад

13,304 Просмотров

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


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

Yaroslav Minakov
Yaroslav Minakov - 24.06.2022 13:09

Based

Ответить
Night Fury
Night Fury - 31.08.2023 02:20

sorry, noob question here
why use multiple if and return and not if else if and return?

Ответить
Jason Grant
Jason Grant - 25.08.2023 21:33

I came here confused and i left more confused

Ответить
AoMafura
AoMafura - 26.07.2023 11:44

What's the problem with &&?
Also, does this have any effect on improving rerendering lag?

Ответить
Skoozle
Skoozle - 14.06.2023 20:55

could u do switch statement instead of doing if?

Ответить
The News Guy
The News Guy - 20.05.2023 13:47

I'll just stop using react and use vue

Ответить
Keshav Kannan
Keshav Kannan - 14.08.2022 18:24

Q: is it ok to throw those jsx inside the if statement into an object so we can iterate through it??

Ответить
chris huang
chris huang - 07.08.2022 18:11

Greate Video, I agreed with you, I like the early return concept. Thank you

Ответить
Atmos4
Atmos4 - 20.07.2022 22:35

Why not use switch instead of the ifs?

Ответить
Whoman
Whoman - 17.07.2022 08:43

Instead of this, I would have create an array of jsx code. And return from Question like this

return [....all my jsx code][rating];

Ответить
Bayu Prathama
Bayu Prathama - 15.07.2022 14:24

how about using switch case in <Question/>?

Ответить
Lindaine
Lindaine - 10.07.2022 12:23

This is a very important video tbh, it's better to have smaller components that handles its own simple logic than one big component that handles everything.

Ответить
belkocik
belkocik - 04.07.2022 09:28

Beginners like it! 🙂

Ответить
mohamed youssef
mohamed youssef - 27.06.2022 07:37

++++++++++++++++++🙂

Ответить
Marko Kraljevic
Marko Kraljevic - 26.06.2022 15:28

you should use switch case and assign jsx to variable instead of return

Ответить
lazyboi
lazyboi - 24.06.2022 16:55

I agree with you. But my boy, you need to work on cleaning up your code damn

Ответить
Karl Nassar
Karl Nassar - 24.06.2022 02:17

What's your opinion on conditional rendering with && vs ternary operator : ?

Ответить
yoitsba
yoitsba - 23.06.2022 18:05

You could slim this up even more since some of those cases are the exact same and only a variable changes.

Ответить
Do Some Coding
Do Some Coding - 23.06.2022 17:04

Switch will be more cleaner😊

Ответить
Jair Smith
Jair Smith - 23.06.2022 15:07

How does this compare to just using a map/object to store the rating number to title and placeholder

Ответить
Iion learn
Iion learn - 23.06.2022 14:24

awesome,and can you do a video on how to,render tooltip ,model,popup depending on condition, like if sucess ,warning ,etc... with different color,based on condition it should change the entire color of the component, so that we can reuse the component

Ответить
Ali
Ali - 23.06.2022 12:35

This is very useful for beginners, thank you.

Ответить
latze
latze - 23.06.2022 12:26

Great video tom!

Ответить