μ₯λ°κ΅¬λμ μνμ΄ μμ΅λλ€.
home2 › κ²μν › React κ²μν › Cannot read properties of null (reading 'useContext')
react part2 μμ react-bootstrapμ¬μ©νλ λΆλΆμμ μκΎΈ μμ μ μλ¬κ° λ¨λ€μ. <Button></Button>μμ μλ¬κ° λ°μνλ κ² κ°μ΅λλ€.
μμ import μν΄λ¨μ΅λκΉ
μ½λ μ λ¬Έμ λλ€.
import logo from './logo.svg'; import './App.css'; import {Button} from 'react-bootstrap'; import 'bootstrap/dist/css/bootstrap.min.css';
function App() { return ( <div> <Button variant='primary'>Primary</Button> </div> ); }
export default App;
https://react-bootstrap.github.io/components/buttons/ μ΄κ±°λλ‘ import ν΄λ΄ μλ€
importλ¬Έμ λ°κΏλ λ¬Έμ κ° ν΄κ²°λμ§ μλ€μ. npm startμ λλ₯Όλλ§λ€ ? Something is already running on port 3000. Probably: μ΄λ° λ©μΈμ§κ° λ¨λλ° νΉμ μ΄ λ¬Έμ μ κ΄λ ¨μ΄ μμκΉμ?
μ€μΉκ³Όμ μμ λ¬Έμ κ° μμλ κ² κ°μ΅λλ€. λ€μ μ§μ°κ³ μ€μΉνλ μ μμ μΌλ‘ μλνλ€μ.