#impossible to pass props

1 messages · Page 1 of 1 (latest)

mild raft
#
className={`${color ?? "text-red-500"}`}

default color not working
if i don't pass color from parent
normally my thong on the right of ?? take over
but it doesn't work on remix

do you have to do something special?

hot stump
#

I tried recreating it and the default value seems to work for me. Can you post the complete component?

function Parent() {
  return (
    <Test />
  ) 
}

function Test(props: any) {
  return (
    <div className={`${props.color ?? "text-red-500"}`}>
      Hello World
    </div>
  )
}