microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.58k stars 2.74k forks source link

[Bug]: ref does not exist on DataGrid components when generics are used #32984

Open ling1726 opened 1 month ago

ling1726 commented 1 month ago

Component

DataGrid

Package version

latest

React version

18

Environment

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (32) x64 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
    Memory: 57.76 GB / 62.77 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash

Current Behavior

Adding a ref to a DataGrid component that uses generics results in an error

Expected Behavior

Refs should be usable on DataGrid components with generics

Reproduction

https://stackblitz.com/edit/idut6z?file=src%2Fexample.tsx

Steps to reproduce

Open repo and find the TS error

Are you reporting an Accessibility issue?

None

Suggested severity

Medium - Has workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

ling1726 commented 1 month ago

Workaround is to stop using the generic braces and cast render function arguments