Do not require double-nesting of custom TechDocs readers.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user