wikibook / react-deep-dive-example

《모던 리액트 Deep Dive》 예제 코드
https://wikibook.co.kr/react-deep-dive/
158 stars 35 forks source link

[문의][오타] p.387 오타 문의드립니다. #19

Closed haryan248 closed 5 months ago

haryan248 commented 9 months ago

인쇄일 : 초판발행 2023년 11월 07일 오타: 책에는 useReducer가 빠진 것 같습니다.

useAtomValue

  // Pull the atoms's state from the store into React state.
  const [[version, valueFromReducer, atomFromReducer], rerenderIfChanged] =
    useReducer<
      Reducer<
        readonly [VersionObject | undefined, Awaited<Value>, Atom<Value>],
        VersionObject | undefined
      >,
      VersionObject | undefined
    >(
      (prev, nextVersion) => {
        const nextValue = getAtomValue(nextVersion)
        if (Object.is(prev[1], nextValue) && prev[2] === atom) {
          return prev // bail out
        }
        return [nextVersion, nextValue, atom]
      },
      versionFromProvider,
      (initialVersion) => {
        const initialValue = getAtomValue(initialVersion)
        return [initialVersion, initialValue, atom]
      }
    )
yceffort commented 9 months ago

@haryan248 님, 제보해주셔서 감사합니다. 코드 내용 좀 줄이려고 하는 과정에서 실수가 있었던 것 같습니다 ㅠ

이 내용 수정하도록 하겠습니다. 감사합니다.

wikibook commented 9 months ago

@haryan248 님, 안녕하세요. 위키북스 담당자입니다.

제보해 주신 내용을 저자분께서 확인해 주셔서 홈페이지 정오표란에 다음과 같이 오탈자로 등록했습니다.

참고 부탁드리고요, 제보해 주신 내용은 다음 인쇄 때 반영하도록 하겠습니다. 그럼 오늘도 편안한 하루 보내시고요, 즐거운 주말 맞이하시기 바랍니다. 고맙습니다.