Do not require double-nesting of custom TechDocs readers.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2022-04-15 16:41:28 +02:00
parent 82124f1837
commit ee60ad9ea4
3 changed files with 15 additions and 17 deletions
+8 -8
View File
@@ -162,11 +162,11 @@ The `techDocsPage` is a default techdocs reader page which lives in
having to set anything up.
```tsx
<TechDocsReaderPage>
<Page themeId="documentation">
<TechDocsReaderPageHeader />
<TechDocsReaderPageSubheader />
<TechDocsReaderPageContent />
</TechDocsReaderPage>
</Page>
```
If you would like to compose your own `techDocsPage`, you can do so by replacing
@@ -174,30 +174,30 @@ the children of TechDocsPage with something else. Maybe you are _just_
interested in replacing the Header:
```tsx
<TechDocsReaderPage>
<Page themeId="documentation">
<Header type="documentation" title="Custom Header" />
<TechDocsReaderPageContent />
</TechDocsReaderPage>
</Page>
```
Or maybe you want to disable the in-context search
```tsx
<TechDocsReaderPage>
<Page themeId="documentation">
<Header type="documentation" title="Custom Header" />
<TechDocsReaderPageContent withSearch={false} />
</TechDocsReaderPage>
</Page>
```
Or maybe you want to replace the entire TechDocs Page.
```tsx
<TechDocsReaderPage>
<Page themeId="documentation">
<Header type="documentation" title="Custom Header" />
<Content data-testid="techdocs-content">
<p>my own content</p>
</Content>
</TechDocsReaderPage>
</Page>
```
## How to migrate from TechDocs Alpha to Beta