playwright/packages/playwright-ct-react
Simon Knott 208a54529d
fix(ct-react): support shorthand fragment notation (#32900)
Closes https://github.com/microsoft/playwright/issues/32853

Vite turns the shorthand fragment notation `<></>` into `import {
Fragment } from "react"; <Fragment></Fragment>`. On the Node.js side of
things, this `react` import resolves to our mock version of React, which
currently mocks `Fragment` as `{}`. Currently, we pass that straight to
`React.createElement`, which throws an error.

The fix is to make our `Fragment` mock detectable with a tag, and when
we render it replace it with the real `__pwReact.Fragment`.
2024-10-02 11:19:09 +02:00
..
.npmignore chore: fix cli executable bits (#20973) 2023-02-16 19:49:44 -08:00
cli.js chore: pass the private data to the runner via config (#29467) 2024-02-13 09:34:03 -08:00
hooks.d.ts feat(ct): resolve hooksConfig import refs (#31024) 2024-05-28 12:29:52 -07:00
hooks.mjs feat(ct): allow configuring apps per test (#15551) 2022-07-12 09:37:33 -07:00
index.d.ts fix(ct): import ct* flavour types from ct-core and then from pwt (#31642) 2024-07-16 19:32:51 +02:00
index.js chore: pass the private data to the runner via config (#29467) 2024-02-13 09:34:03 -08:00
package.json chore: mark 1.49.0-next (#32873) 2024-09-30 04:24:57 -07:00
README.md chore: add disclaimer to experimental ct packages (#14075) 2022-05-10 10:59:30 -07:00
register.d.ts chore(ct): dedupe types (#28816) 2024-01-07 19:45:42 -08:00
register.mjs chore(ct): do not clash internals with userland (#21774) 2023-03-17 18:08:28 -07:00
registerSource.mjs fix(ct-react): support shorthand fragment notation (#32900) 2024-10-02 11:19:09 +02:00

BEWARE This package is EXPERIMENTAL and does not respect semver.

Read more at https://playwright.dev/docs/test-components