diff --git a/packages/fluentui/CHANGELOG.md b/packages/fluentui/CHANGELOG.md index 4dc987341b950..a8d944c911709 100644 --- a/packages/fluentui/CHANGELOG.md +++ b/packages/fluentui/CHANGELOG.md @@ -57,6 +57,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Fix `Chat` components to properly pass ref to root slots @chpalac ([#20691](https://github.com/microsoft/fluentui/pull/20691)) - Fix `Flex` component to properly pass ref to root slots @chpalac ([#20752](https://github.com/microsoft/fluentui/pull/20752)) - Fix `Animation` to expose `Transition` state for the consumer @chpalac ([#20776](https://github.com/microsoft/fluentui/pull/20776)) +- Fix `Grid` component to properly pass ref to root slots @chpalac ([#20810](https://github.com/microsoft/fluentui/pull/20810)) - Fix `Form` components to properly pass ref to root slots @chpalac ([#20809](https://github.com/microsoft/fluentui/pull/20809)) - Fix `Loader` component to properly pass ref to root slots @chpalac ([#20814](https://github.com/microsoft/fluentui/pull/20814)) - Fix `Label` component to properly pass ref to root slots @chpalac ([#20813](https://github.com/microsoft/fluentui/pull/20813)) diff --git a/packages/fluentui/react-northstar/src/components/Grid/Grid.tsx b/packages/fluentui/react-northstar/src/components/Grid/Grid.tsx index 57edeb880a9e7..cc3c214aeb439 100644 --- a/packages/fluentui/react-northstar/src/components/Grid/Grid.tsx +++ b/packages/fluentui/react-northstar/src/components/Grid/Grid.tsx @@ -1,12 +1,12 @@ import { Accessibility, GridBehaviorProps } from '@fluentui/accessibility'; import { - ComponentWithAs, getElementType, useAccessibility, useStyles, useFluentContext, useTelemetry, useUnhandledProps, + ForwardRefWithAs, } from '@fluentui/react-bindings'; import * as customPropTypes from '@fluentui/react-proptypes'; import * as PropTypes from 'prop-types'; @@ -43,7 +43,7 @@ export type GridStylesProps = Pick; /** * A Grid is a layout component that harmonizes negative space, by controlling both the row and column alignment. */ -export const Grid: ComponentWithAs<'div', GridProps> & FluentComponentStaticProps = props => { +export const Grid = (React.forwardRef((props, ref) => { const context = useFluentContext(); const { setStart, setEnd } = useTelemetry(Grid.displayName, context.telemetry); setStart(); @@ -74,6 +74,7 @@ export const Grid: ComponentWithAs<'div', GridProps> & FluentComponentStaticProp & FluentComponentStaticProp setEnd(); return element; -}; +}) as unknown) as ForwardRefWithAs<'div', HTMLDivElement, GridProps> & FluentComponentStaticProps; Grid.displayName = 'Grid';