mobx (3) 썸네일형 리스트형 Mobx 기초 정리 1. Observable State - 바뀌는 부분 즉각 보임. 2. Computed - 계산이 필요한 부분에 적용 3. Reaction - 내부값 변환시 특정 log 호출 4. Actions - 상태에 변화를 일으킴 Redux는 단일 스토어지만 Mobx는 다중 Store를 사용한다. Mobx에서는 State를 사용하지 않고 이를 observable이 대체한다. class를 사용한다. Provider로 index.tsx 내부를 감싸줘야 한다. Provider useStore = {useStores} --> 이 스토어를 사용하겠다. 그리고 Container단과 스토어가 소통을 하고 있다면 Container 전체를 observer로 감싸줘야한다. 이런 식으로.(inject가 조금 더 안정성이 높다) ----.. Module not found: Can't resolve 'mobx/dist/internal' 오류 (computed 사용시) 처음 보는 에러가.. 구글링을 해도 안떴다 원인은 간단했음 import { computed } from "mobx/dist/internal"; 이렇게 import가 되어있었는데 import { makeObservable, observable, action, computed } from "mobx"; mobx쪽으로 import를 바꿈 왜 dist/internal로 import가 됐었는지는 모르겠다. Mobx Computeds with arguments 번역. Computeds with arguments 인수가 있는 computed The computed annotation can only be used on getters, which don't take arguments. What about computations that do take arguments? computed는 인수를 사용하지 않는 게터에만 사용할 수 있다. 그러면 인수들을 가지는 computed는 어떤가? Take the below example of a React component that renders a specific Item, and the application supports multi-selection. multi selection을 지원하는 어플리케이션의 특정 요소를 렌더링하는 .. 이전 1 다음