Skip to content

Commit 7850f08

Browse files
authored
Update key to rerender RestCodeSamples (github#26093)
1 parent 59618c6 commit 7850f08

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

components/rest/RestCodeSamples.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { xCodeSample } from './types'
22
import { useTranslation } from 'components/hooks/useTranslation'
33
import { CodeBlock } from './CodeBlock'
4+
import { Fragment } from 'react'
45

56
type Props = {
67
slug: string
@@ -11,7 +12,7 @@ export function RestCodeSamples({ slug, xCodeSamples }: Props) {
1112
const { t } = useTranslation('products')
1213

1314
return (
14-
<>
15+
<Fragment key={xCodeSamples + slug}>
1516
<h4 id={`${slug}--code-samples`}>
1617
<a href={`#${slug}--code-samples`}>{`${t('rest.reference.code_samples')}`}</a>
1718
</h4>
@@ -29,6 +30,6 @@ export function RestCodeSamples({ slug, xCodeSamples }: Props) {
2930
}
3031
return sampleElements
3132
})}
32-
</>
33+
</Fragment>
3334
)
3435
}

components/rest/RestReferencePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const RestReferencePage = ({
9898
// Note! This "core selector", which determines whether to bother
9999
// or not, needs to match what's used inside ClientSideHighlightJS.tsx
100100
if (document.querySelector('[data-highlight]')) {
101-
setLazyLoadHighlightJS(false)
101+
setLazyLoadHighlightJS(true)
102102
}
103103

104104
// Important to depend on the current path because the first page you

0 commit comments

Comments
 (0)