mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-29 06:29:03 +02:00
fix(website): fix APITable anchor ID having extra hash (#5948)
This commit is contained in:
parent
1816f135f2
commit
11f9a54a32
1 changed files with 3 additions and 2 deletions
|
@ -41,11 +41,12 @@ const APITableRow = forwardRef(
|
|||
ref: React.RefObject<HTMLTableRowElement>,
|
||||
) => {
|
||||
const entryName = getText(children);
|
||||
const anchor = name ? `#${name}-${entryName}` : `#${entryName}`;
|
||||
const id = name ? `${name}-${entryName}` : entryName;
|
||||
const anchor = `#${id}`;
|
||||
const history = useHistory();
|
||||
return (
|
||||
<tr
|
||||
id={anchor}
|
||||
id={id}
|
||||
tabIndex={0}
|
||||
ref={history.location.hash === anchor ? ref : undefined}
|
||||
onClick={() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue