동적 키를 구성 객체를 추적 할 필요가있다, 그래서 나는이 같은 구성 요소에 전달 : 나는 구성 요소의 내가 식별 할 수 componentWillReceiveProps(nextProps)
구성 변경에 오전 때물건을 받침대로 전달하는 것이 componentWillReceiveProps를 방해합니까? 응용 프로그램 반응 내
<Component configuration={this.state.configuration}>
이, 작동하지만 this.props
은 이미 nextProps
으로 업데이트 되었기 때문에
알려진 문제가 아니라면 부모의 구성 상태에 대한 업데이트를 처리하는 방법과 관련이 있습니까? 구성 상태를 업데이트하는 방법은 다음과 같습니다.
handleConfigurationChangeForKey(newOption, key) {
const configObject = this.state.configuration;
configObject[key] = newOption;
this.setState({configuration: configObject});
}
미리 도움을 요청하십시오.
멋진 대답을 특징으로하는 방법과 새로운 확산 연산자를 사용하는 나를 보여 주셔서 감사합니다. – ed94133