[Redux] Vanilla JavaScript에 Redux 적용하기(store, reducer) #0


[Redux] Vanilla JavaScript에 Redux 적용하기(store, reducer) #0

npx create-react-app , 먼저 순수 자바스크립트로 숫자 카운터 기능을 구현해 본다. //index.html <!DOCTYPE html> <html lang="en"> <head> ... </head> <body> <button id="add">Add</button> <span>0</span> <button id="minus">Minus</button> </body> </html> //index.js const add = document.getElementById("add"); const minus = document.getElementById("minus"); const number = document.querySelector("span"); let count = 0; number.innerText = count; const updateText = () => { number.innerText = count; }; const handleAdd = () => { coun...


#createStore #data #modify #reducer #redux #state #store #리덕스

원문링크 : [Redux] Vanilla JavaScript에 Redux 적용하기(store, reducer) #0