Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wrap console.log with __DEV__ and add a todo
  • Loading branch information
broccolinisoup committed Feb 15, 2023
commit bdba7403dc6253e6c3b3d598b1aab2fe7f61cf9a
13 changes: 8 additions & 5 deletions src/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,14 @@ const Navigation: React.FC<React.PropsWithChildren<NavigationProps>> = ({
'aria-label': ariaLabel,
'aria-labelledby': ariaLabelledBy,
}) => {
if (as === 'nav' && !ariaLabel && !ariaLabelledBy) {
// eslint-disable-next-line no-console
console.warn(
'Use `aria-label` or `aria-labelledby` prop to provide an accessible label to the `nav` landmark for assistive technology',
)
// TODO: use warning utility function when it is merged https://github.com/primer/react/pull/2901/
if (__DEV__) {
if (as === 'nav' && !ariaLabel && !ariaLabelledBy) {
// eslint-disable-next-line no-console
console.warn(
'Use `aria-label` or `aria-labelledby` prop to provide an accessible label to the `nav` landmark for assistive technology',
)
}
}
return (
<Box
Expand Down