Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/gorgeous-jeans-occur.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

replace `Location | Pathname` union type for `to` prop with more appropriate `To`
4 changes: 2 additions & 2 deletions src/Breadcrumbs.tsx
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import classnames from 'classnames'
import {Location, Pathname} from 'history'
import {To} from 'history'
import React from 'react'
import styled from 'styled-components'
import Box from './Box'
Expand DownExpand Up@@ -54,7 +54,7 @@ function Breadcrumbs({className, children, sx: sxProp}: React.PropsWithChildren<
}

type StyledBreadcrumbsItemProps = {
to?: Location | Pathname
to?: To
selected?: boolean
} & SxProp

Expand Down
4 changes: 2 additions & 2 deletions src/SideNav.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import {Location, Pathname} from 'history'
import {To} from 'history'

import {get} from './constants'
import styled, {css} from 'styled-components'
Expand DownExpand Up@@ -54,7 +54,7 @@ const SideNav = styled(SideNavBase)<SxProp>`
${sx};
`
type StyledSideNavLinkProps = {
to?: Location | Pathname
to?: To
selected?: boolean
variant?: 'full' | 'normal'
}
Expand Down
4 changes: 2 additions & 2 deletions src/SubNav.tsx
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import classnames from 'classnames'
import {Location, Pathname} from 'history'
import {To} from 'history'
import React from 'react'
import styled from 'styled-components'
import {get} from './constants'
Expand DownExpand Up@@ -58,7 +58,7 @@ const SubNavLinks = styled.div<SubNavLinksProps>`
`

type StyledSubNavLinkProps = {
to?: Location | Pathname
to?: To
selected?: boolean
} & SxProp

Expand Down
4 changes: 2 additions & 2 deletions src/TabNav.tsx
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import classnames from 'classnames'
import {Location, Pathname} from 'history'
import {To} from 'history'
import React from 'react'
import styled from 'styled-components'
import {get} from './constants'
Expand DownExpand Up@@ -32,7 +32,7 @@ function TabNav({children, 'aria-label': ariaLabel, ...rest}: TabNavProps) {
}

type StyledTabNavLinkProps = {
to?: Location | Pathname
to?: To
selected?: boolean
} & SxProp

Expand Down
4 changes: 2 additions & 2 deletions src/UnderlineNav.tsx
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import classnames from 'classnames'
import {Location, Pathname} from 'history'
import {To} from 'history'
import React from 'react'
import styled from 'styled-components'
import {get} from './constants'
Expand DownExpand Up@@ -59,7 +59,7 @@ function UnderlineNav({actions, className, align, children, full, label, theme,
}

type StyledUnderlineNavLinkProps = {
to?: Location | Pathname
to?: To
selected?: boolean
} & SxProp

Expand Down