From 1fc0265f5dfcdb7a6f371ca74b44a5ea07ade369 Mon Sep 17 00:00:00 2001 From: jackrabbit128 Date: Wed, 2 Oct 2024 22:39:26 +0200 Subject: [PATCH 1/3] docs: clarify component naming for markdown import (#10542) --- .../docs/guides/markdown-features/markdown-features-react.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/guides/markdown-features/markdown-features-react.mdx b/website/docs/guides/markdown-features/markdown-features-react.mdx index 0dd4b6d32a27..03520ff4c4a1 100644 --- a/website/docs/guides/markdown-features/markdown-features-react.mdx +++ b/website/docs/guides/markdown-features/markdown-features-react.mdx @@ -301,6 +301,7 @@ This feature is experimental and might be subject to breaking API changes in the ## Importing Markdown {#importing-markdown} You can use Markdown files as components and import them elsewhere, either in Markdown files or in React pages. +In the `import` statement, you can name the component anything you like but it must be capitalized. By convention, using the **`_` filename prefix** will not create any doc page and means the Markdown file is a **"partial"**, to be imported by other files. From b9edccc69135470184e9174c4fb1662e8e55e43b Mon Sep 17 00:00:00 2001 From: jackrabbit128 Date: Wed, 2 Oct 2024 23:18:04 +0200 Subject: [PATCH 2/3] Apply review suggestion Co-authored-by: Joshua Chen --- .../docs/guides/markdown-features/markdown-features-react.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/markdown-features/markdown-features-react.mdx b/website/docs/guides/markdown-features/markdown-features-react.mdx index 03520ff4c4a1..de639d7c8c27 100644 --- a/website/docs/guides/markdown-features/markdown-features-react.mdx +++ b/website/docs/guides/markdown-features/markdown-features-react.mdx @@ -301,7 +301,7 @@ This feature is experimental and might be subject to breaking API changes in the ## Importing Markdown {#importing-markdown} You can use Markdown files as components and import them elsewhere, either in Markdown files or in React pages. -In the `import` statement, you can name the component anything you like but it must be capitalized. +Each MDX file default-exports its page content as a React component. In the `import` statement, you can default-import this component with any name, but it must be capitalized following React's naming rules. By convention, using the **`_` filename prefix** will not create any doc page and means the Markdown file is a **"partial"**, to be imported by other files. From 81e3d8e7226da9edf8e5422177f23f0b262c5668 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Wed, 2 Oct 2024 17:35:44 -0400 Subject: [PATCH 3/3] Update website/docs/guides/markdown-features/markdown-features-react.mdx --- .../docs/guides/markdown-features/markdown-features-react.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-react.mdx b/website/docs/guides/markdown-features/markdown-features-react.mdx index de639d7c8c27..0c63b0b3a966 100644 --- a/website/docs/guides/markdown-features/markdown-features-react.mdx +++ b/website/docs/guides/markdown-features/markdown-features-react.mdx @@ -300,8 +300,7 @@ This feature is experimental and might be subject to breaking API changes in the ## Importing Markdown {#importing-markdown} -You can use Markdown files as components and import them elsewhere, either in Markdown files or in React pages. -Each MDX file default-exports its page content as a React component. In the `import` statement, you can default-import this component with any name, but it must be capitalized following React's naming rules. +You can use Markdown files as components and import them elsewhere, either in Markdown files or in React pages. Each MDX file default-exports its page content as a React component. In the `import` statement, you can default-import this component with any name, but it must be capitalized following React's naming rules. By convention, using the **`_` filename prefix** will not create any doc page and means the Markdown file is a **"partial"**, to be imported by other files.