Skip to content

Commit

Permalink
docs: add import React statement in JSX file example (#7050)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaycebasques authored Mar 29, 2022
1 parent b5fc9a6 commit e31e91e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e31e91e

Please sign in to comment.