Using version 2.7.1.
I call setProps()
on my root wrapper. I notice that it does trigger componentWillReceiveProps
, and a new render
on the component being tested.
But, the prop is not coming through.
When I use console.log()
's in my component, I don't see my new/changed prop. So, in other words:
componentWillReceiveProps(props) {
console.log(props) // The new prop is not in there... or any altered props. Same as when initialized
}
render() {
console.log(props) // The new prop is not in there... or any altered props. Same as when initialized
}
When I don't call setProps()
, then the componentWillReceiveProps
doesn't run. SO, I know that setProps()
is running, and it's triggering a re-render. But, the props in my object are not coming through.
Any thoughts?
I'm using the method like this wrapper.setProps({ myNewProp: '123' })
. But, myNewProp
is never found in my props
when I'm console.log()
ing out the props
.
I have made a mistake. This is not an issue. I apologize.
If anyone else has this problem, and is using redux, make sure that the component is not being lost in the Provider wrapper.
Most helpful comment
I have made a mistake. This is not an issue. I apologize.
If anyone else has this problem, and is using redux, make sure that the component is not being lost in the Provider wrapper.