Skip to main content

Command Palette

Search for a command to run...

Conditional rendering in ReactJS

Updated
1 min readView as Markdown
Conditional rendering in ReactJS

Conditional rendering is a term to describe the ability to render different user interface (UI) markup if a condition is true or false. Example :

{courseGoals.length > 0
 && 
( <CourseGoalList   items={courseGoals} />) }

if the first condition is true , the second element is rendered automatically , but if the 1st condition is false nothing is rendered , So (true && something) return " something " but ( false && something) return nothing .

More from this blog

Omar's blog

135 posts