프로젝트를 통해 얻을 수 있는 React 기술들
초기 셋팅 법 :
①. 프로젝트 생성할 폴더 위치로 Vscode 접속 후, 터미널 창에 react 프로젝트 생성
npm create vite@latest
②. 명령어 후에 생성된 폴더로 vsCode 위치를 옮긴 뒤, 아래의 명령어를 통해, react 나머지 파일들 생성
npm i
③. [eslint.config.js]
파일 코드 내 ruls 수정
import js from "@eslint/js";
import globals from "globals";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
export default [
{ ignores: ["dist"] },
{
files: ["**/*.{js,jsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: "latest",
ecmaFeatures: { jsx: true },
sourceType: "module",
},
},
settings: { react: { version: "18.3" } },
plugins: {
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"no-unused-vars": "off",
"react/prop-types": "off",
},
},
];
④. Router 설치