MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / App

Function App

Video 109/src/App.jsx:6–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import './App.css'
5
6function App() {
7 const [count, setCount] = useState(0)
8 const btnRef = useRef()
9
10 useEffect(() => {
11 console.log(`First rendering..`)
12 btnRef.current.style.backgroundColor = "red"
13 }, []);
14
15
16 return (
17 <>
18 <div>
19 <a href="https://vitejs.dev" target="_blank">
20 <img src={viteLogo} className="logo" alt="Vite logo" />
21 </a>
22 <a href="https://react.dev" target="_blank">
23 <img src={reactLogo} className="logo react" alt="React logo" />
24 </a>
25 </div>
26 <h1>Vite + React</h1>
27 <div className="card">
28 <button ref={btnRef} onClick={() => setCount((count) => count + 1)}>
29 count is {count}
30 </button>
31 <p>
32 Edit <code>src/App.jsx</code> and save to test HMR
33 </p>
34 </div>
35 <p className="read-the-docs">
36 Click on the Vite and React logos to learn more
37 </p>
38 <button onClick={()=>{btnRef.current.style.display = "none"}}>Change me</button>
39 </>
40 )
41}
42
43export default App

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected