1

I have a react component which is connected to a parent container. The container has mapStateToProps. I have a console log in the container. The props are updating. I can SEE the prop updating in the component/child.

componentDidUpdate is not being called. I have no idea how a render could possibly be called without componentDidUpdate being called. But that is happening. I see the component update on my screen, I have the props console.logged and they are updating. But componentDidUpdate is not. I feel like I'm crazy.

Has anyone experienced this before??

1
  • 3
    Could you include this component code in the question? Commented Aug 1, 2018 at 23:15

1 Answer 1

1

I'm running into something similar now. Wondering if my component is unmounting/remounting, which would cause render without calling componentDidUpdate, right?

UPDATE: Yep, my component was unmounting/remounting because a parent component was responding to the change in redux state by no longer rendering my component. Can't call componentDidUpdate if I don't exist, and won't call componentDidUpdate if I'm mounting!

Sign up to request clarification or add additional context in comments.

1 Comment

For those experiencing the same, componentDidMount() is one option to explore.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.