Enzyme: Shallow renderer never call componentDidUpdate in v16.

Created on 4 Aug 2017  路  6Comments  路  Source: enzymejs/enzyme

Shallow render no longer call componentDidUpdate from 16.0.0-beta.3.

https://github.com/facebook/react/pull/10372

Currently, enzyme's shallow calls cDU manually when calling setProps with lifecycleExperimental flag.
By this change, we need to call cDU manually even if setState is called with lifecycleExperimental flag.

But enzyme has a plan that lifecycleExperimental is default in v3.
In the case, we need to always call cDU except disableLifecycleMethods is true.

I can work on this, but it will be based on this PR.

Most helpful comment

In React 16, the shallow renderer is not supposed to call cDU. That's what those PRs address.

All 6 comments

We do not support alphas or betas of React. When we do support it, we'll have to adapt to this behavior, but it'll be adapter-specific. See #1007.

Yeah, I don't mean enzyme should support React alphas or betas, which is just to report what enzyme should resolve until v3.

BTW, Does enzyme have a plan to support React RCs?

I've just encountered this with the released version, should this be reopened?

It's been addressed with #1133 and #1139.

馃 It's still not working for me, not sure why, I'll try to isolate the use-case.

In React 16, the shallow renderer is not supposed to call cDU. That's what those PRs address.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rexonms picture rexonms  路  3Comments

amcmillan01 picture amcmillan01  路  3Comments

mattkauffman23 picture mattkauffman23  路  3Comments

timhonders picture timhonders  路  3Comments

blainekasten picture blainekasten  路  3Comments