Skip to content
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

[docs] Move the demo higher in the API TOC #35202

Merged
Merged
Changes from 1 commit
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
12 changes: 9 additions & 3 deletions docs/src/modules/components/ApiPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ function ApiDocs(props) {
createTocEntry('import'),
...componentDescriptionToc,
componentStyles.name && createTocEntry('component-name'),
createTocEntry('demos'),
createTocEntry('props'),
componentStyles.classes.length > 0 && createTocEntry('css'),
createTocEntry('demos'),
].filter(Boolean);

// The `ref` is forwarded to the root element.
Expand Down Expand Up @@ -331,6 +331,14 @@ import { ${componentName} } from '${source}';`}
/>
</React.Fragment>
)}
<Heading hash="demos" />
<p
dangerouslySetInnerHTML={{
__html:
'The following component guides include examples on how to use this React component:',
}}
/>
<span dangerouslySetInnerHTML={{ __html: demos }} />
<Heading hash="props" />
<p dangerouslySetInnerHTML={{ __html: spreadHint }} />
<PropsTable componentProps={componentProps} propDescriptions={propDescriptions} />
Expand Down Expand Up @@ -376,8 +384,6 @@ import { ${componentName} } from '${source}';`}
/>
</React.Fragment>
) : null}
<Heading hash="demos" />
<span dangerouslySetInnerHTML={{ __html: demos }} />
</MarkdownElement>
<svg style={{ display: 'none' }} xmlns="http://www.w3.org/2000/svg">
<symbol id="anchor-link-icon" viewBox="0 0 16 16">
Expand Down