Skip to content

Table doesn't forward refs #6370

@BryGuy96

Description

@BryGuy96

Table doesn't forward refs, but other components like TableHeader does

Expected Behavior

Table forwards ref

Actual Behavior

The following warning is produced in the console

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

URL, screen shot, or Codepen exhibiting the issue

https://codesandbox.io/s/nostalgic-rgb-tddnjy?file=/src/App.tsx

Steps to Reproduce

  1. Supply a Table component with a ref
  2. Check console for warning

Your Environment

  • Grommet version: 2.26.0 in Codesandbox; Also experienced in 2.25.1
  • Browser Name and version: Chrome
  • Operating System and version (desktop or mobile): macOS 11.6.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA suggestion to add to or change behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions