Ref not working for Plasmic component

Hello guys!

I’m trying to create a custom ref for my plasmic component, but it seems doesn’t work, the ref always keeps null.

I tried to ways (code for explanatory purposes only)

import React from 'react'

function Header() {
    const ref = React.useRef(null)

  return (
    <PlasmicHeader
        root={{
            ref,
        }}
    />
  )
}

export default Header

and

import React from 'react'

function Header() {
    const ref = React.useRef(null)

  return (
    <PlasmicHeader
        ref={ref}
    />
  )
}

export default Header

Not sure if this solves your problem, but when creating your own refs in plasmic, they can‘t be named ref.
Call it headerRef for example.

@assured_coyote you should be able to get refs of your components, are you using codegen? Can you share your full actual code?

he is using codegen and the problem was solved with a named ref