보라코딩
프론트엔드를 위한 리액트 프로젝트 만들기 본문
1. PowerShell이나 터미널에서 새 리액트 앱 만든다
npx create-react-app carfront
2. 프로젝트로 폴더 이동 후 머티리얼 UI 컴포턴트 라이브러리 설치
cd carfront
npm install @mui/material @emotion/react @emotion/styled
3. 앱 실행
npm start
4. VS code에서 src 폴더 열고 App.js 파일 작성
import logo from "./logo.svg";
import "./App.css";
import AppBar from "@mui/material/AppBar";
import Toolbar from "@mui/material/Toolbar";
import Typography from "@mui/material/Typography";
function App() {
return (
<div className="App">
<AppBar position="static">
<Toolbar>
<Typography variant="h6">Carshop</Typography>
</Toolbar>
</AppBar>
</div>
);
}
export default App;

mui 사이트 이용해서 쉽게 프론트엔드 모형 수정할 수 있다.
App Bar React component - Material UI
The App Bar displays information and actions relating to the current screen.
mui.com
스프링부트 백엔드 준비
SecurityConfig
configure 메서드 수정하기
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().cors().and()
.authorizeHttpRequests().anyRequest().permitAll();
}
'코딩 > REACT' 카테고리의 다른 글
리액트 CRUD 기능 추가하기2 (0) | 2023.08.01 |
---|---|
리액트 CRUD 기능 추가하기 (0) | 2023.07.26 |
VS Code Extension 추천 (REACT 관련) (0) | 2023.07.25 |
리액트 : div 너무 많을 땐 Component (0) | 2023.07.13 |
리액트 : state가 array/object인 경우 (0) | 2023.07.13 |