DEV Community

Discussion on: Simplify condition rendering in React.js

Collapse
 
jfullerco profile image
jfullerco

This is a question, not a critique, is it not necessary to check for the existence of the conditional variable if you use the NOT operator?

Fwiw, great post! Definitely will use this as inspiration for some component refactoring on my current project.

Thanks!!

Collapse
 
rmurati profile image
Redžep Murati

Hello, no actually you don't have to every falsy value is considered as false.

Collapse
 
jfullerco profile image
jfullerco

Thanks! That’s super helpful to know!