Skip to content

Commit 7d05dbb

Browse files
authored
Add displayName to Link + NavLink (#7958) (#7968)
1 parent 9de81d2 commit 7d05dbb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/react-router-dom/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
235235
}
236236
);
237237

238+
if (__DEV__) {
239+
Link.displayName = "Link";
240+
}
241+
238242
export interface NavLinkProps extends LinkProps {
239243
activeClassName?: string;
240244
activeStyle?: object;
@@ -293,6 +297,10 @@ export const NavLink = React.forwardRef<HTMLAnchorElement, NavLinkProps>(
293297
}
294298
);
295299

300+
if (__DEV__) {
301+
NavLink.displayName = "NavLink";
302+
}
303+
296304
export interface PromptProps {
297305
message: string;
298306
when?: boolean;

0 commit comments

Comments
 (0)