Skip to content

fix(docs): update VariantItem link implementation and separate CLI version docs Closes npm/cli#8414 #1659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
19 changes: 14 additions & 5 deletions src/components/variant-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
box-shadow: var(--shadow-resting-medium, 0 3px 6px rgba(140, 149, 159, 0.15));
`

const VariantItem = ({title, shortName, url, active}) => (
<ActionList.Item as={LinkNoUnderline} to={url} state={{scrollUpdate: false}} id={shortName} active={active}>
{title}
</ActionList.Item>
)
const VariantItem = ({title, shortName, url, active}) => {
return (
<ActionList.Item state={{scrollUpdate: false}} id={shortName} active={active}>
<LinkNoUnderline to={url}>{title}</LinkNoUnderline>
</ActionList.Item>
)
}

const useVariantFocus = () => {
const locationChange = useLocationChange()
Expand All @@ -37,6 +39,13 @@
const [open, setOpen] = React.useState(false)
const anchorRef = useVariantFocus()
const labelId = 'label-versions-list-item'
const locationChange = useLocationChange()

React.useEffect(() => {
if (locationChange.change && getNav.didVariantChange(locationChange.previous, locationChange.current)) {
setOpen(false)
}
}, [locationChange.change, locationChange.current, locationChange.previous])

Check warning on line 48 in src/components/variant-select.js

View workflow job for this annotation

GitHub Actions / Lint

React Hook React.useEffect has a missing dependency: 'locationChange'. Either include it or remove the dependency array. Mutable values like 'locationChange.current' aren't valid dependencies because mutating them doesn't re-render the component

return (
<>
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy