summaryrefslogtreecommitdiff
path: root/packages/integrations/react/test/fixtures/react-component
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-10-24 08:05:19 -0400
committerGravatar GitHub <noreply@github.com> 2023-10-24 08:05:19 -0400
commit4dee38711cbf83efb5e12fbfa8e69e2495c49acf (patch)
tree05de3ac83e729935ab72cd2ada07e03ddcb0c3d8 /packages/integrations/react/test/fixtures/react-component
parent5dd1ed50b2f9428946b0b273e0ce8f13c19aa3b5 (diff)
downloadastro-4dee38711cbf83efb5e12fbfa8e69e2495c49acf.tar.gz
astro-4dee38711cbf83efb5e12fbfa8e69e2495c49acf.tar.zst
astro-4dee38711cbf83efb5e12fbfa8e69e2495c49acf.zip
Fix client hydration in experimentalReactChildren (#8898)
* Fix client hydration in experimentalReactChildren * Add tests * Add a changeset * Use recursion instead of walking * getChildren -> swap order --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/react/test/fixtures/react-component')
-rw-r--r--packages/integrations/react/test/fixtures/react-component/src/components/WithChildren.jsx4
-rw-r--r--packages/integrations/react/test/fixtures/react-component/src/pages/children.astro6
2 files changed, 7 insertions, 3 deletions
diff --git a/packages/integrations/react/test/fixtures/react-component/src/components/WithChildren.jsx b/packages/integrations/react/test/fixtures/react-component/src/components/WithChildren.jsx
index 500c0c694..a522bf95e 100644
--- a/packages/integrations/react/test/fixtures/react-component/src/components/WithChildren.jsx
+++ b/packages/integrations/react/test/fixtures/react-component/src/components/WithChildren.jsx
@@ -1,8 +1,8 @@
import React from 'react';
-export default function ({ children }) {
+export default function ({ id, children }) {
return (
- <div>
+ <div id={id}>
<div className="with-children">{children}</div>
<div className="with-children-count">{children.length}</div>
</div>
diff --git a/packages/integrations/react/test/fixtures/react-component/src/pages/children.astro b/packages/integrations/react/test/fixtures/react-component/src/pages/children.astro
index 59595c266..3f83eafcb 100644
--- a/packages/integrations/react/test/fixtures/react-component/src/pages/children.astro
+++ b/packages/integrations/react/test/fixtures/react-component/src/pages/children.astro
@@ -7,7 +7,11 @@ import WithChildren from '../components/WithChildren';
<!-- Head Stuff -->
</head>
<body>
- <WithChildren>
+ <WithChildren id="one">
+ <div>child 1</div><div>child 2</div>
+ </WithChildren>
+
+ <WithChildren id="two" client:load>
<div>child 1</div><div>child 2</div>
</WithChildren>
</body>