Commit 596b1f44 authored by Tino-25's avatar Tino-25

Cài đặt src đầu tiên + chakra-ui/react + devtool

parent 6893a189
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@tanstack/react-query-devtools": "^4.36.1",
"framer-motion": "^11.3.30",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1" "react-dom": "^18.3.1"
}, },
......
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css' import './App.css'
import { Button } from '@chakra-ui/react';
function App() { function App() {
const [count, setCount] = useState(0)
return ( return (
<> <>
<div> <Button colorScheme='blue'>Button</Button>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</> </>
) )
} }
export default App export default App
// import { useState } from 'react'
// import reactLogo from './assets/react.svg'
// import viteLogo from '/vite.svg'
// import './App.css'
// import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
// function App() {
// const [count, setCount] = useState(0)
// return (
// <>
// <div>
// <a href="https://vitejs.dev" target="_blank">
// <img src={viteLogo} className="logo" alt="Vite logo" />
// </a>
// <a href="https://react.dev" target="_blank">
// <img src={reactLogo} className="logo react" alt="React logo" />
// </a>
// </div>
// <h1>Vite + React</h1>
// <div className="card">
// <button onClick={() => setCount((count) => count + 1)}>
// count is {count}
// </button>
// <p>
// Edit <code>src/App.tsx</code> and save to test HMR
// </p>
// </div>
// <p className="read-the-docs">
// Click on the Vite and React logos to learn more
// </p>
// </>
// )
// }
// export default App
...@@ -3,8 +3,26 @@ import { createRoot } from 'react-dom/client' ...@@ -3,8 +3,26 @@ import { createRoot } from 'react-dom/client'
import App from './App.tsx' import App from './App.tsx'
import './index.css' import './index.css'
createRoot(document.getElementById('root')!).render( import { ChakraProvider } from '@chakra-ui/react';
const root = createRoot(document.getElementById('root')!);
root.render(
<StrictMode> <StrictMode>
<App /> <ChakraProvider> {/* Bao bọc ứng dụng bằng ChakraProvider */}
</StrictMode>, <App />
) </ChakraProvider>
</StrictMode>
);
// import { StrictMode } from 'react'
// import { createRoot } from 'react-dom/client'
// import App from './App.tsx'
// import './index.css'
// createRoot(document.getElementById('root')!).render(
// <StrictMode>
// <App />
// </StrictMode>,
// )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment