summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/framework-react/src/components/Counter.jsx4
-rw-r--r--examples/framework-react/src/pages/index.astro6
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/framework-react/src/components/Counter.jsx b/examples/framework-react/src/components/Counter.jsx
index 3ab6728e7..b7b219aae 100644
--- a/examples/framework-react/src/components/Counter.jsx
+++ b/examples/framework-react/src/components/Counter.jsx
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
-export default function Counter({ children }) {
- const [count, setCount] = useState(0);
+export default function Counter({ children, count: initialCount }) {
+ const [count, setCount] = useState(initialCount);
const add = () => setCount((i) => i + 1);
const subtract = () => setCount((i) => i - 1);
diff --git a/examples/framework-react/src/pages/index.astro b/examples/framework-react/src/pages/index.astro
index 851eb6e78..79f2ddf74 100644
--- a/examples/framework-react/src/pages/index.astro
+++ b/examples/framework-react/src/pages/index.astro
@@ -1,7 +1,9 @@
---
// Component Imports
import Counter from '../components/Counter.jsx'
-
+const someProps = {
+ count: 0,
+}
// Full Astro Component Syntax:
// https://docs.astro.build/core-concepts/astro-components/
@@ -34,7 +36,7 @@ import Counter from '../components/Counter.jsx'
</head>
<body>
<main>
- <Counter client:visible>
+ <Counter {...someProps} client:visible>
<h1>Hello React!</h1>
</Counter>
</main>
/span> 2024-02-24prevent warning: `Astro.request.headers` is not available in "static" output ...Gravatar Arsh 2-27/+30 2024-02-23Improved error logging from config (#10207)Gravatar Ben Holmes 4-36/+67 2024-02-23[ci] formatGravatar Arsh 3-3/+3 2024-02-23fix(dev): remove params for prerendered pages (#10199)Gravatar Arsh 9-13/+78 2024-02-23[ci] release (#10213)astro@4.4.4@astrojs/vercel@7.3.3@astrojs/node@8.2.1@astrojs/db@0.4.0Gravatar Houston (Bot) 41-177/+95 2024-02-23Fixes edge middleware calling nested routes (#10215)Gravatar Matthew Phillips 2-1/+6 2024-02-23Adds an error message for non-string transition:name values (#10205)Gravatar Martin Trapp 2-0/+8 2024-02-23[ci] formatGravatar Furkan Erdem 1-1/+1 2024-02-23Fix(node): Custom headers are not present in responses from standalone Node s...Gravatar Furkan Erdem 8-0/+163