From 1712f9edb663104ea4f5b9817b535a159655708a Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Sat, 10 Apr 2021 12:35:25 -0700 Subject: [PATCH] add counter component --- examples/blog/astro/components/Counter.jsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/blog/astro/components/Counter.jsx diff --git a/examples/blog/astro/components/Counter.jsx b/examples/blog/astro/components/Counter.jsx new file mode 100644 index 0000000000..3fb32dea72 --- /dev/null +++ b/examples/blog/astro/components/Counter.jsx @@ -0,0 +1,17 @@ +import React, { useState } from 'react'; +import confetti from 'canvas-confetti'; + +export default function Counter() { + // Declare a new state variable, which we'll call "count" + const [count, setCount] = useState(0); + console.log(confetti()); + + return ( +
+

You clicked {count} times

+ +
+ ); +} \ No newline at end of file