mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 02:08:36 +02:00
docs: add import React statement in JSX file example (#7050)
This commit is contained in:
parent
b5fc9a6b6d
commit
e31e91ef47
1 changed files with 2 additions and 0 deletions
|
@ -110,6 +110,8 @@ The `@site` alias points to your website's directory, usually where the `docusau
|
|||
While declaring components within Markdown is very convenient for simple cases, it becomes hard to maintain because of limited editor support, risks of parsing errors, and low reusability. Use a separate `.js` file when your component involves complex JS logic:
|
||||
|
||||
```jsx title="src/components/Highlight.js"
|
||||
import React from 'react';
|
||||
|
||||
export default function Highlight({children, color}) {
|
||||
return (
|
||||
<span
|
||||
|
|
Loading…
Add table
Reference in a new issue