diff --git a/.changeset/spotty-berries-grow.md b/.changeset/spotty-berries-grow.md new file mode 100644 index 000000000000..efb7e9004ce5 --- /dev/null +++ b/.changeset/spotty-berries-grow.md @@ -0,0 +1,5 @@ +--- +'@astrojs/react': patch +--- + +Only pass through children prop if there are children diff --git a/packages/astro/test/fixtures/react-component/src/components/CloneElement.jsx b/packages/astro/test/fixtures/react-component/src/components/CloneElement.jsx new file mode 100644 index 000000000000..809ac4aa43fc --- /dev/null +++ b/packages/astro/test/fixtures/react-component/src/components/CloneElement.jsx @@ -0,0 +1,6 @@ +import { cloneElement } from 'react'; + +const ClonedWithProps = (element) => (props) => + cloneElement(element, props); + +export default ClonedWithProps(