Skip to content

Documentation for ReactWrapper#update is wrong #1405

@RoystonS

Description

@RoystonS

Hi,

The latest documentation for ReactWrapper#update (
https://github.com/airbnb/enzyme/blob/3ac9895c03e71816e58bc534aa6dd635e9311f59/docs/api/ReactWrapper/update.md) appears to be incorrect.

It states that calling .update() forces a re-render. I believe that was the case in Enzyme 2, but is no longer the case in Enzyme 3. It now merely refreshes the wrapper tree from the React tree.

I'd also like to confirm with you that it's the documentation that's incorrect and not the behaviour, and that you don't plan to change update so it does cause a re-render? It's very important that we are able to refresh wrappers without triggering React re-renders, because we sometimes need to check that a particular set of operations has caused a render to happen already.

(Out of interest, we're currently in the middle of upgrading our several-thousand unit tests from Enzyme 2 to Enzyme 3 and have around 200 failing tests as a result. The main problem is due to the semantic change in wrappers no longer being live views of the React render tree.)

Thanks,
Royston.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions