I have a situation in my React component which is: i want some elements to be wrappend in a Link component if this.props.isComingFromModal is false
Link
this.props.isComingFromModal
My simple functional solution:
const ConditionalLink = ({ children, to, condition }) => (!!condition && to) ? {children} : <>{children}>;
Then you can use it like this: