I need to render my components with conditional rendering. I am applying a or ( || ) operator for applying a condition. But the condition is not working anyhow.
{ pathName !== '/login' || pathName !== '/signup' || pathName !== '/account' &&
<Footer />
}
I have also wrap the conditions in the round brackets but then also it is not working.
{ [(pathName !== '/login') || (pathName !== '/signup') || (pathName !== '/account')] &&
<Footer />
}
Please let me know what i am doing wrong. ?
Sandeep Panda
co-founder, Hashnode
Can you try this?
{ (pathName !== '/login' || pathName !== '/signup' || pathName !== '/account') && <Footer /> }