import { memo } from "react"; function If({ children, condition }) { return condition ? children : null; } export default memo(If, (props, oldProps) => props.condition === oldProps.condition);
This is a really good expression of it. I've been trying to do something very similar since we have something like
<Title> {newAccount ? "newtitle": "oldtitle"}</Title>
but we have a few ways for newAccount to be true something like
<IF condition={isNewAccount}> This is a new account</IF>
is a start
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is a really good expression of it.
I've been trying to do something very similar since we have something like
but we have a few ways for newAccount to be true
something like
is a start