我有一个选择saga is called的下拉列表,必须使用相同的组件。saga被称为唯一没有发生的事情是set状态在saga调用之前正在更新,因此组件从不更新数据。 recievedChangeValue=(selectVal)=>{
console.log(selectVal)
if(selectVal==='Yearly'){
this.props.getYearlySales() **//call to saga**
这是filter在dplyr中的预期行为吗?听起来很可怕。我是错过了什么,还是错了版本?
mydf <- data.frame(x = 1:5, y = c(letters[1:3], rep(NA, 2)))
mydf
x y
1 1 a
2 2 b
3 3 c
4 4 <NA>
5 5 <NA>
filter(mydf, y != 'a')
x y
1 2 b
2 3 c
packageVersion('dplyr')
[1] ‘0.7.2’
我发现我的状态没有被正确更新。如果你看到下面的代码,console.log(this.props.clickedImage)给出了我期望的值,但console.log(this.state.items);没有。 我正在使用componentWillReceiveProps()更新它,但我不确定这是不是一个好方法。做这件事最好的方法是什么? 父级: constructor(props){
super(props);
// set the state to handle which of the panes displays the information you want
我有包含task的状态的父组件和处理更改其名称的输入的子组件。输入使用自己的name状态作为输入值。在submit或blur之后,调用父函数来更新父级task.name的状态。在父服务器上,componentDidUpdate()是通过websocket发送到服务器的新状态,服务器将更改发送给另一个客户端。
我的组件保持值是因为它处于状态,但是在另一个客户机(刚刚从服务器收到新值)中,它保持不变,因为输入的值仅在componentDidMount()中设置。如何将新状态强制到这些子组件?
亲本
componentDidMount() {
//Recieve changed data f