diff --git a/src/components/MDX/SandpackWithHTMLOutput.tsx b/src/components/MDX/SandpackWithHTMLOutput.tsx index 134da65897..51ce28dc14 100644 --- a/src/components/MDX/SandpackWithHTMLOutput.tsx +++ b/src/components/MDX/SandpackWithHTMLOutput.tsx @@ -20,7 +20,7 @@ export default function ShowRenderedHTML({children}) { {formatHTML(markup)} - ); + ); }`; const formatHTML = ` @@ -77,8 +77,8 @@ export default memo(function SandpackWithHTMLOutput( ) { const children = [ ...Children.toArray(props.children), - createFile('ShowRenderedHTML.js', ShowRenderedHTML), - createFile('formatHTML.js hidden', formatHTML), + createFile('src/ShowRenderedHTML.js', ShowRenderedHTML), + createFile('src/formatHTML.js hidden', formatHTML), createFile('package.json hidden', packageJSON), ]; return {children}; diff --git a/src/content/reference/react-dom/components/link.md b/src/content/reference/react-dom/components/link.md index 890cf09000..fcbb9fab01 100644 --- a/src/content/reference/react-dom/components/link.md +++ b/src/content/reference/react-dom/components/link.md @@ -96,7 +96,7 @@ In addition, if the `` is to a stylesheet (namely, it has `rel="stylesheet There are two exception to this special behavior: -* If the link doesn't have a `precedence` prop, there is no special behavior, because the order of stylesheets within the document is significant, so React needs to know how to order this stylesheet relative to others, which you specify using the `precedence` prop. +* If the link doesn't have a `precedence` prop, there is no special behavior, because the order of stylesheets within the document is significant, so React needs to know how to order this stylesheet relative to others, which you specify using the `precedence` prop. * If you supply any of the `onLoad`, `onError`, or `disabled` props, there is no special behavior, because these props indicate that you are managing the loading of the stylesheet manually within your component. This special treatment comes with two caveats: @@ -114,7 +114,7 @@ You can annotate the document with links to related resources such as an icon, c -```js App.js active +```js src/App.js active import ShowRenderedHTML from './ShowRenderedHTML.js'; export default function BlogPage() { @@ -141,7 +141,7 @@ When you want to use a stylesheet, it can be beneficial to call the [preinit](/r -```js App.js active +```js src/App.js active import ShowRenderedHTML from './ShowRenderedHTML.js'; export default function SiteMapPage() { @@ -164,7 +164,7 @@ Stylesheets can conflict with each other, and when they do, the browser goes wit -```js App.js active +```js src/App.js active import ShowRenderedHTML from './ShowRenderedHTML.js'; export default function HomePage() { @@ -195,7 +195,7 @@ If you render the same stylesheet from multiple components, React will place onl -```js App.js active +```js src/App.js active import ShowRenderedHTML from './ShowRenderedHTML.js'; export default function HomePage() { diff --git a/src/content/reference/react-dom/components/meta.md b/src/content/reference/react-dom/components/meta.md index 859e3f2f7d..285e5ad6bf 100644 --- a/src/content/reference/react-dom/components/meta.md +++ b/src/content/reference/react-dom/components/meta.md @@ -72,7 +72,7 @@ React 对 `` 的扩展当前仅在 React Canary 与 experimental 渠道中 -```js App.js active +```js src/App.js active import ShowRenderedHTML from './ShowRenderedHTML.js'; export default function SiteMapPage() { diff --git a/src/content/reference/react-dom/components/script.md b/src/content/reference/react-dom/components/script.md index 50c0af8030..a2c4668c92 100644 --- a/src/content/reference/react-dom/components/script.md +++ b/src/content/reference/react-dom/components/script.md @@ -91,7 +91,7 @@ If you supply an `src` and `async` prop, your component will suspend while the s -```js App.js active +```js src/App.js active import ShowRenderedHTML from './ShowRenderedHTML.js'; function Map({lat, long}) { @@ -124,7 +124,7 @@ To include an inline script, render the `