#is there a better way to write this code?

7 messages · Page 1 of 1 (latest)

snow furnace
#

<Dynamic> is what you're looking for I think

#

<Dynamic component={props.link ? <Link { ...someProps }/> : <div />} />

snow furnace
#

Okay, didn't know that.

snow furnace
graceful flame
#

Also, I think you would do component={props.link ? Link : "div"}

snow furnace
#

Yes. I didn't think much about it. It is incorrect