Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions react-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
```

export const Counter = () => {
const [count, setCount] = useState(0)

Check warning on line 57 in react-components.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

react-components.mdx#L57

Did you really mean 'setCount'?

const increment = () => setCount(count + 1)
const decrement = () => setCount(count - 1)
Expand Down Expand Up @@ -94,6 +94,10 @@

You can import components from your `snippets` folder. Unlike regular React, you cannot import components from every `MDX` file. Reusable components must be referenced from files within the `snippets` folder. Learn more about [reusable snippets](/reusable-snippets).

<Warning>
**Important limitation**: You cannot import a snippet into another snippet. This means you cannot import React components from one snippet file into another snippet file. Snippets can only be imported into regular MDX pages.
</Warning>

### Example

This example declares a `ColorGenerator` component that uses multiple React hooks and then uses it in an `MDX` file.
Expand Down
4 changes: 4 additions & 0 deletions reusable-snippets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ should create a custom snippet to keep your content in sync.

**Pre-condition**: You must create your snippet file in the `snippets` directory in order for the import to work.

<Warning>
**Important limitation**: You cannot import a snippet into another snippet. Snippets can only be imported into regular MDX pages, not into other files within the `snippets` directory.
</Warning>

Any page in the `snippets` directory will be treated as a snippet and will not
be rendered into a standalone page. If you want to create a standalone page
from the snippet, import the snippet into another file and call it as a
Expand Down