ngIf in React
In this post, we can see how we can use the traditional ngif statement in React. This post is for beginners in React.
If you are an angular developer you might have used *ngIf statement. so recently I have been into react js and at a moment I wanted to use conditional rendering. so immediately I thought of using something similar to ngif. so I got many references from StackOverflow but many of them were like writing some additional methods for handling this conditional rendering.
But I know, there is always a for doing this in a different way. So this was short and simple and easy to implement, what all you need to do is.
{condition && <jsx> you wanted to render <jsx/>}
voila! so next time for a conditional rendering use the above syntax.
Happy programming!!