mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 06:50:36 +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>,
|
ref: React.RefObject<HTMLTableRowElement>,
|
||||||
) => {
|
) => {
|
||||||
const entryName = getText(children);
|
const entryName = getText(children);
|
||||||
const anchor = name ? `#${name}-${entryName}` : `#${entryName}`;
|
const id = name ? `${name}-${entryName}` : entryName;
|
||||||
|
const anchor = `#${id}`;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
id={anchor}
|
id={id}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
ref={history.location.hash === anchor ? ref : undefined}
|
ref={history.location.hash === anchor ? ref : undefined}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue