Skip to content

Stack does not properly forward ref #5446

Closed
@iansan5653

Description

@iansan5653

Stack appears to accept a ref prop based on the TypeScript types, but this ref is not actually bound to the underlying element:

export function Example() {
  const ref = useRef<HTMLDivElement>(null)

  useEffect(() => console.log(ref.current))

  return <Stack {...props} ref={ref}>contents</Stack>
}

If Stack correctly forwarded its ref, the console would log an HTMLDivElement instance. However, it instead always logs null.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions