1차 공부/설정관련 3

타입스크립트

//타입스크립트로 cra하기 npx create-react-app project-title --template typescript //or yarn create react-app project-title --template typescript //js파일을 타입스크립트로 바꾸기위해 설치 npm install --save typescript @types/node @types/react @types/react-dom @types/jest //or yarn add typescript @types/node @types/react @types/react-dom @types/jest tsconfig.json파일이 없다면 추가로 설정 //tsconfig.json npx tsc --init "jsx": "react-j..

리덕스툴킷, json server, axios

리덕스 툴킷 설치 yarn add react-redux @reduxjs/toolkit 툴킷 리듀서 예시 // src/redux/modules/counterSlice.js import { createSlice } from "@reduxjs/toolkit"; const initialState = { number: 0, }; const counterSlice = createSlice({ name: "counter", initialState, reducers: { addNumber: (state, action) => { state.number = state.number + action.payload; }, minusNumber: (state, action) => { state.number = state.numb..

리액트 리덕스 스타일드컴포넌트 리액트라우터돔 설정

리덕스깔기 yarn add redux react-redux 스타일드컴포넌트깔기 yarn add styled-components 리액트라우터돔 깔기 yarn add react-router-dom 폴더설정 (https://codingpracticenote.tistory.com/89) 라우터 돔 했던 거 파일배치 configStore설정 //src/redux/config/configStore.js import { createStore } from "redux"; import { combineReducers } from "redux"; /* 1. createStore() 리덕스의 가장 핵심이 되는 스토어를 만드는 메소드(함수) 입니다. 리덕스는 단일 스토어로 모든 상태 트리를 관리한다고 설명해 드렸죠? 리덕스를..