Reactjs 使用道具对DND动态投放目标进行反应

Reactjs 使用道具对DND动态投放目标进行反应,reactjs,drag-and-drop,react-dnd,Reactjs,Drag And Drop,React Dnd,我正在尝试使用DND处理2个容器 1) 容器具有静态数据表单axios=>tasks列表。 2) 容器只有设置为用户的任务 <Container id={1} list={this.props.tasks}/> <Container id={2} list={this.state.userTasks}/> 我不能使用组件将接收道具(nextrops)放入容器(子容器),因为我只需要更新容器(2),当我将元素从容器移动到容器(2) 当我更改用户时,如何更新容器(2)卡?你

我正在尝试使用DND处理2个容器

1) 容器具有静态数据表单axios=>tasks列表。 2) 容器只有设置为用户的任务

<Container id={1} list={this.props.tasks}/>
<Container id={2} list={this.state.userTasks}/>
我不能使用
组件将接收道具(nextrops)
放入容器(子容器),因为我只需要更新容器(2),当我将元素从容器移动到容器(2)


当我更改用户时,如何更新容器(2)卡?你有什么想法吗

我想当用户信息更改时,您可以在呈现
容器的父组件处重置该组件的状态信息

组件将接收道具(下一步){
if(nextrops.userId!==this.props.userId){
this.setState({userTasks:[]})}

}

您是否使用任何存储/状态管理框架,如flux或Redux?
constructor(props) {
        super(props);
        this.state = {cards: props.list};
    }