Is conditional rendering good in React?

It works great for simple use cases , and every programmer knows how it works. But there’s a lot of repetition, and the render method looks crowded. So let’s simplify it by extracting all the conditional logic to two render methods: one to render the input box and another to render the button.12 Eki 2020

Read more

Can I return in switch case?

It’s idiomatic to return from case statements, and it’s “unreachable code” noise otherwise. Personally I would remove the returns and keep the breaks. I would use the switch statement to assign a value to a variable. Then return that variable after the switch statement.

Read more