()
| 5 | import Navbar from './components/Navbar' |
| 6 | |
| 7 | function App() { |
| 8 | const [count, setCount] = useState(0) |
| 9 | const [count2, setCount2] = useState(0) |
| 10 | const [adjective, setAdjective] = useState("good") |
| 11 | |
| 12 | // const getAdjective = () => { |
| 13 | // return "another" + count |
| 14 | // } |
| 15 | |
| 16 | const getAdjective = useCallback(() => { |
| 17 | return "another" + count |
| 18 | },[count] ) |
| 19 | |
| 20 | |
| 21 | |
| 22 | return ( |
| 23 | <> |
| 24 | <Navbar adjective={"good"} getAdjective={getAdjective} /> |
| 25 | <div> |
| 26 | <a href="https://vitejs.dev" target="_blank"> |
| 27 | <img src={viteLogo} className="logo" alt="Vite logo" /> |
| 28 | </a> |
| 29 | <a href="https://react.dev" target="_blank"> |
| 30 | <img src={reactLogo} className="logo react" alt="React logo" /> |
| 31 | </a> |
| 32 | </div> |
| 33 | <h1>Vite + React</h1> |
| 34 | <div className="card"> |
| 35 | <button onClick={() => setCount((count) => count + 1)}> |
| 36 | count is {count} |
| 37 | </button> |
| 38 | <p> |
| 39 | Edit <code>src/App.jsx</code> and save to test HMR |
| 40 | </p> |
| 41 | </div> |
| 42 | <p className="read-the-docs"> |
| 43 | Click on the Vite and React logos to learn more |
| 44 | </p> |
| 45 | </> |
| 46 | ) |
| 47 | } |
| 48 | |
| 49 | export default App |
nothing calls this directly
no outgoing calls
no test coverage detected