I am trying to render boolean value inside JSX, however React is evaluating it as expression and isn\'t returning anything after the component is returned.
Any worka
You can convert boolean value to string, concatenating it with empty string:
var ipsumText = true;
ReactDOM.render(
Boolean Value: {ipsumText + ''}
,
document.getElementById('impl')
);
Or you can do it, when assigning bool value to variable:
var ipsumText = true + '';
ReactDOM.render(
Boolean Value: {ipsumText}
,
document.getElementById('impl')
);
If your variable can have not boolean value, you should convert it to boolean:
// `ipsumText` variable is `true` now.
var ipsumText = !!'text';