summaryrefslogtreecommitdiff
path: root/examples/framework-multiple/src/components/react
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-08-11 10:05:02 -0400
committerGravatar GitHub <noreply@github.com> 2023-08-11 10:05:02 -0400
commit519a1c4e8407c7abcb8d879b67a9f4b960652cae (patch)
tree1d102fa0e3a64e885d9872c2ed944f76ca10a16c /examples/framework-multiple/src/components/react
parent2ee418e06ab1f7855dee0078afbad0b06de3b183 (diff)
downloadastro-519a1c4e8407c7abcb8d879b67a9f4b960652cae.tar.gz
astro-519a1c4e8407c7abcb8d879b67a9f4b960652cae.tar.zst
astro-519a1c4e8407c7abcb8d879b67a9f4b960652cae.zip
JSX refactor (#7924)
* JSX refactor * Get preact/compat test to pass * Use include config * Remove old astro flavored markdown test * Move babel dep to preact * Remove errant debugger * Update lockfile * Update the multi-framework example * Update e2e tests * Fix nested-in-vue tests * Add back in astro check * Update packages/astro/src/core/create-vite.ts Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Update packages/astro/src/core/create-vite.ts Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Update packages/integrations/solid/src/index.ts Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Update packages/integrations/solid/src/index.ts Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Update .changeset/perfect-horses-tell.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Move the comment about the include config * Remove redundant alias config * Use react's own preamble code * Use the base for the preamble * Remove solid redundancy * Update .changeset/perfect-horses-tell.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update based on review comments * Oops --------- Co-authored-by: Fred K. Schott <fkschott@gmail.com> Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Diffstat (limited to 'examples/framework-multiple/src/components/react')
-rw-r--r--examples/framework-multiple/src/components/react/ReactCounter.tsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/framework-multiple/src/components/react/ReactCounter.tsx b/examples/framework-multiple/src/components/react/ReactCounter.tsx
new file mode 100644
index 000000000..1cff97917
--- /dev/null
+++ b/examples/framework-multiple/src/components/react/ReactCounter.tsx
@@ -0,0 +1,19 @@
+import { useState } from 'react';
+
+/** A counter written with React */
+export function Counter({ children }) {
+ const [count, setCount] = useState(0);
+ const add = () => setCount((i) => i + 1);
+ const subtract = () => setCount((i) => i - 1);
+
+ return (
+ <>
+ <div className="counter">
+ <button onClick={subtract}>-</button>
+ <pre>{count}</pre>
+ <button onClick={add}>+</button>
+ </div>
+ <div className="counter-message">{children}</div>
+ </>
+ );
+}
abe5d2acfaaca&follow=1'>Update config base type description (#4954)Gravatar Zihan Chen 1-1/+10 2022-10-04Support Astro.slots.render for mdx (#4973)Gravatar Bjorn Lu 8-2/+69 2022-10-03[ci] release (#4968)astro@1.4.4Gravatar Fred K. Bot 28-57/+58 2022-10-03Fix regression in rendering strings (#4967)Gravatar Matthew Phillips 2-2/+9 2022-10-03[ci] formatGravatar matthewp 1-1/+2 2022-10-03Adds a better test for benchmarking (#4966)Gravatar Matthew Phillips 2-7/+77 2022-10-03Benchmark action: provide the PR number (#4964)Gravatar Matthew Phillips 1-0/+1 2022-10-03Build packages in the benchmark action (#4962)Gravatar Matthew Phillips 1-0/+11 2022-10-03Run benchmarks on comment (#4960)Gravatar Matthew Phillips 2-1/+85 2022-10-03[ci] release (#4957)astro@1.4.3@astrojs/mdx@0.11.4Gravatar Fred K. Bot 32-70/+69 2022-10-03[ci] formatGravatar matthewp 5-6/+6 2022-10-03Improve rendering perf (#4956)Gravatar Matthew Phillips 8-31/+73 2022-10-03Suppress eslint warnings (#4953)Gravatar Bjorn Lu 3-3/+14 2022-10-03[ci] formatGravatar bluwy 1-1/+1 2022-10-03Refactor ViteConfigWithSSR type (#4952)Gravatar Bjorn Lu 7-20/+20 2022-10-01[ci] release (#4945)@astrojs/image@0.9.11.3.0Gravatar Fred K. Bot 3-6/+7 2022-09-30Astro image cache dependency fix scottaw66 (#4944)Gravatar Scott Willsey 3-3/+7 2022-09-30[ci] release (#4943)astro@1.4.2Gravatar Fred K. Bot 29-60/+58 2022-09-30[ci] formatGravatar natemoo-re 1-1/+1 2022-09-30Convert HTMLString to regular string, preventing hydration script fro… (#4932)Gravatar Matthew Phillips 2-1/+6 2022-10-01Fix missing language tag on README code block (#4940)Gravatar Chris Swithinbank 1-1/+1 2022-09-30[ci] formatGravatar natemoo-re 2-2/+2 2022-09-30P5: fix MDX memory leak (#4939)Gravatar Nate Moore 10-1/+84 2022-09-30chore: delete .stackblitzrc files from examples (#4922)Gravatar Nate Moore 22-132/+0