Skip to content

Commit 9b08472

Browse files
committed
Forwards refs to the items in the Menu component
1 parent 6c16662 commit 9b08472

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/layout.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Link, graphql, useStaticQuery } from "gatsby";
22
import { GatsbyImage } from "gatsby-plugin-image";
33
import { Grommet } from "grommet";
4-
import type * as React from "react";
4+
import * as React from "react";
55
import "./layout.css";
66
import {
77
Box,
@@ -61,11 +61,15 @@ const AppHeader = () => {
6161
items={[
6262
actionItems.map((action) => ({
6363
label: action,
64-
as: (props) => <Link to={`/${action}`} {...props} />,
64+
as: React.forwardRef((props, ref) => (
65+
<Link to={`/${action}`} {...props} ref={ref} />
66+
)),
6567
})),
6668
extensionItems.map((extension) => ({
6769
label: extension,
68-
as: (props) => <Link to={`/${extension}`} {...props} />,
70+
as: React.forwardRef((props, ref) => (
71+
<Link to={`/${extension}`} {...props} ref={ref} />
72+
)),
6973
})),
7074
]}
7175
/>

0 commit comments

Comments
 (0)