mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 21:03:47 +02:00
feat: React 18 + automatic JSX runtime + build --dev (#8961)
This commit is contained in:
parent
76f920359b
commit
187e5aa218
69 changed files with 404 additions and 209 deletions
|
@ -51,17 +51,3 @@ export default function BrowserWindow({
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Quick and dirty component, to improve later if needed
|
||||
export function IframeWindow({url}: {url: string}): JSX.Element {
|
||||
return (
|
||||
<div style={{padding: 10}}>
|
||||
<BrowserWindow
|
||||
url={url}
|
||||
style={{minWidth: '40vw', maxWidth: 400}}
|
||||
bodyStyle={{padding: 0}}>
|
||||
<iframe src={url} title={url} style={{width: '100%', height: 300}} />
|
||||
</BrowserWindow>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -47,9 +47,8 @@ export default function ConfigTabs({
|
|||
}
|
||||
</Translate>
|
||||
</p>
|
||||
<p>
|
||||
<CodeBlock language="js" title="docusaurus.config.js">
|
||||
{`module.exports = {
|
||||
<CodeBlock language="js" title="docusaurus.config.js">
|
||||
{`module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
|
@ -61,8 +60,7 @@ export default function ConfigTabs({
|
|||
],
|
||||
],
|
||||
};`}
|
||||
</CodeBlock>
|
||||
</p>
|
||||
</CodeBlock>
|
||||
</TabItem>
|
||||
<TabItem value="plugin" label={translate({message: 'Plugin options'})}>
|
||||
<p>
|
||||
|
@ -71,9 +69,8 @@ export default function ConfigTabs({
|
|||
the plugin:
|
||||
</Translate>
|
||||
</p>
|
||||
<p>
|
||||
<CodeBlock language="js" title="docusaurus.config.js">
|
||||
{`module.exports = {
|
||||
<CodeBlock language="js" title="docusaurus.config.js">
|
||||
{`module.exports = {
|
||||
plugins: [
|
||||
[
|
||||
'${pluginName}',
|
||||
|
@ -83,8 +80,7 @@ export default function ConfigTabs({
|
|||
],
|
||||
],
|
||||
};`}
|
||||
</CodeBlock>
|
||||
</p>
|
||||
</CodeBlock>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
);
|
||||
|
|
|
@ -15,7 +15,7 @@ export default function CustomDogfoodNavbarItem(props: {
|
|||
mobile?: boolean;
|
||||
}): JSX.Element | null {
|
||||
const {pathname} = useLocation();
|
||||
const shouldRender = pathname.includes('/tests/');
|
||||
const shouldRender = pathname === '/tests' || pathname.startsWith('/tests/');
|
||||
if (!shouldRender) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import LiteYouTubeEmbed from 'react-lite-youtube-embed';
|
||||
import Link from '@docusaurus/Link';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React, {useState, useMemo, useEffect} from 'react';
|
||||
import {useState, useMemo, useEffect} from 'react';
|
||||
import clsx from 'clsx';
|
||||
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
||||
import Translate, {translate} from '@docusaurus/Translate';
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import Link from '@docusaurus/Link';
|
||||
import Translate from '@docusaurus/Translate';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue