edge-city
git clone https://git.pyrossh.dev/edge-city
edge-city is a next level meta-framework for react that runs only on edge runtimes
example/src/components/Counter/Counter.jsx
| e284d5b | 1 | import React, { useState } from "react"; |
| e6b4ebe | 2 | import { Button } from "react-aria-components"; |
| 6b0984a | 3 | import "./Counter.css"; |
| e284d5b | 4 | |
| e284d5b | 5 | const Counter = () => { |
| e284d5b | 6 | const [count, setCount] = useState(5); |
| 6b0984a | 7 | const increment = () => setCount(count - 1); |
| 6b0984a | 8 | const decrement = () => setCount(count + 1); |
| e284d5b | 9 | return ( |
| 6b0984a | 10 | <div className="counter"> |
| 7d46866 | 11 | <Button onPress={increment}> |
| 6b0984a | 12 | - |
| 6b0984a | 13 | </Button> |
| e6b4ebe | 14 | <span className="count">{count}</span> |
| 7d46866 | 15 | <Button onPress={decrement}> |
| 6b0984a | 16 | + |
| 6b0984a | 17 | </Button> |
| e284d5b | 18 | </div> |
| e6b4ebe | 19 | ); |
| e6b4ebe | 20 | }; |
| e284d5b | 21 | |
| e6b4ebe | 22 | export default Counter; |