docusaurus/admin/test-bad-package
Sébastien Lorber f811e2dbf4
Some checks are pending
Argos CI / take-screenshots (push) Waiting to run
Build Hash Router / Build Hash Router (push) Waiting to run
Canary Release / Publish Canary (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Continuous Releases / Continuous Releases (push) Waiting to run
E2E Tests / E2E — Yarn v1 (18.0) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (20) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (22) (push) Waiting to run
E2E Tests / E2E — Yarn v1 (24) (push) Waiting to run
E2E Tests / E2E — Yarn v1 Windows (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (node-modules, -st) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -s) (push) Waiting to run
E2E Tests / E2E — Yarn Berry (pnp, -st) (push) Waiting to run
E2E Tests / E2E — npm (push) Waiting to run
E2E Tests / E2E — pnpm (push) Waiting to run
chore: release 3.8.1 (#11249)
2025-06-06 17:45:58 +02:00
..
README.mdx feat: Add React 19 support to Docusaurus v3 (#10763) 2024-12-24 14:43:03 +01:00
package.json chore: release 3.8.1 (#11249) 2025-06-06 17:45:58 +02:00

# test-bad-package

This package declares a wrong React version on purpose (16.14.0)

The goal is to test that the MD/MDX content of this package can still be imported/rendered by our website.

See related issue https://github.com/facebook/docusaurus/issues/9027

---

import {version as ReactVersion} from 'react';
import {version as ReactDOMVersion} from 'react-dom';

export function TestComponent() {
  const expectedVersion = 19;
  if (!ReactVersion.startsWith(`${expectedVersion}`)) {
    throw new Error(
      `'test-bad-package/README.mdx' is rendered with bad React version: ${ReactVersion}`,
    );
  }
  if (!ReactVersion.startsWith(`${expectedVersion}`)) {
    throw new Error(
      `'test-bad-package/README.mdx' is rendered with bad React-DOM version: ${ReactDOMVersion}`,
    );
  }
  return (
    <>
      <div>React version: {ReactVersion}</div>
      <div>React DOM version: {ReactDOMVersion}</div>
    </>
  );
}

<TestComponent />

---

## MDX Components work:

<details>
  <summary>Summary</summary>

Details

</details>

```js
const age = 42;
```