From 9d4bfc76e8de7cf85997100145532a6fa7d2b025 Mon Sep 17 00:00:00 2001 From: HiDeoo <494699+HiDeoo@users.noreply.github.com> Date: Wed, 25 Jan 2023 23:31:57 +0100 Subject: [PATCH] Support passing `children` as props to a React component (#5886) --- .changeset/fresh-eels-speak.md | 5 +++++ .../react-component/src/components/WithChildren.jsx | 5 +++++ .../test/fixtures/react-component/src/pages/index.astro | 3 +++ packages/astro/test/react-component.test.js | 9 +++++++-- packages/integrations/react/server-v17.js | 5 ++++- packages/integrations/react/server.js | 5 +++-- 6 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .changeset/fresh-eels-speak.md create mode 100644 packages/astro/test/fixtures/react-component/src/components/WithChildren.jsx diff --git a/.changeset/fresh-eels-speak.md b/.changeset/fresh-eels-speak.md new file mode 100644 index 000000000..d826bb516 --- /dev/null +++ b/.changeset/fresh-eels-speak.md @@ -0,0 +1,5 @@ +--- +'@astrojs/react': patch +--- + +Support passing `children` as props to a React component diff --git a/packages/astro/test/fixtures/react-component/src/components/WithChildren.jsx b/packages/astro/test/fixtures/react-component/src/components/WithChildren.jsx new file mode 100644 index 000000000..cdcb0e0a6 --- /dev/null +++ b/packages/astro/test/fixtures/react-component/src/components/WithChildren.jsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function ({ children }) { + return