0 votes
in ReactJS by
How do you print falsy values in JSX in ReactJs?

1 Answer

0 votes
by
The falsy values such as false, null, undefined, and true are valid children but they don't render anything. If you still want to display them then you need to convert it to string. Let's take an example on how to convert to a string,

<div>My JavaScript variable is {String(myVariable)}.</div>
...