단순 코드 기록 214

redux 기초

전체 코드더보기import React, {useState} from "react";import "./style.css";import {createStore} from "redux";import { Provider, useSelector, useDispatch, connect } from "react-redux";const reducer = (currentState, action) => {        if(currentState === undefined){        return {            number: 1,                  // number의 기본값을 1로 지정        };    }    const newState = {...currentState};    if(act..

Router 기초

1. 리액트 라우터 DOM2. 라우터 설치 및 실행3. Link to4. HashRouter5. NavLink6. useParams 전체코드더보기import React from 'react';import ReactDOM from 'react-dom/client';import './index.css';import reportWebVitals from './reportWebVitals';import { HashRouter, Routes, Route, NavLink, useParams } from 'react-router-dom';var contents = [  {id: 1, title: "html", description: "html is..."},  {id: 2, title: "js", descriptio..

React 기초

React를 거의 몇 달만에 다시 만지면서 기초부터 다시 해보자는 생각에 기록하게 되었다. 순서1. 태그의 대소문자2. 사용자 정의 태그(컴포넌트)의 위치3. prop(속성) - props(속성들)3.1 속성 배열 사용4. 초기화하지 않은 함수의 일반형과 람다형5. prop으로 이벤트 전달6. state7. useState8. useState29. Create10. Update11. delete 전체 코드더보기import './App.css';import { useState } from 'react';//App================================================================================function App() {  // 변수  let c..

배포_스프링부트 배포_MVC

이후 동일하게 run as maven build를 하면 된다. SpringBootServletInitializer가 반드시 필요한가? SpringBoot 웹 애플리케이션을 배포할 때는 주로 embedded tomcat이 내장된 jar파일을 이용한다. 하지만 특별한 경우에는 전통적인 배포 방식인 war 파일로 배포를 진행해야 하는 경우가 있을 수 있다. 이럴 경우 SpringBootServletInitializer를 상속받으면 된다. 즉, war 파일로 빌드하고 배포하지 않을 거라면 SpringBootServletInitializer를 상속할 필요가 없다는 의미다. 실제로 위에서 jar로 배포할 때는 SpringBootServletInitializer를 상속하지 않았다. SpringBoot 웹 애플리케이션..