1
간단한 질문 : withState/withHandlers 대신에 withStateHandlers를 사용하고 싶습니다. 직접 상태와 상호 작용해야하므로 stateUpdater
이름이 없습니다 답변 :Recompose : withState/withHandlers withStateHandlers와의 조합과 동일합니다.
간단한 질문 : withState/withHandlers 대신에 withStateHandlers를 사용하고 싶습니다. 직접 상태와 상호 작용해야하므로 stateUpdater
이름이 없습니다 답변 :Recompose : withState/withHandlers withStateHandlers와의 조합과 동일합니다.
withStateHandlers
에 대한
withState('value', 'updateValue', ''),
withHandlers({
onChange: ({updateValue}) => event => updateValue(event.target.value)
})
감사합니다 (귀하의 경우 updateValue
을 등) :이의 equivalant는 무엇인가.
withStateHandlers(
// you define the initial state
{ value: '' },
// this is handler - you return a new state - updated value in this case
{ onChange:() => event => ({ value: event.target.value }) }
)
답장을 보내 주셔서 감사합니다. 왜 내가이 오류가 있는지 아십니까? 'warning.js : 35 경고 : performUpdateIfNecessary : 예상치 못한 배치 번호 (현재 70, 보류 중 69)'? – wyeo
지금은 withState/withHandlers의 조합 만 사용하고 있습니다. – wyeo