Blueprint: Update Portal to use React 16 Portals for simpler unit testing with Enzyme.

Created on 3 Dec 2017  路  4Comments  路  Source: palantir/blueprint

Enzyme has been updated to support React 16 Portals.

React 16 Portals: https://reactjs.org/docs/portals.html
Relevant Enzyme issue: https://github.com/airbnb/enzyme/issues/1150
Relevant Enzyme pull request: https://github.com/airbnb/enzyme/pull/1345

If Blueprint.Portal was updated to make use of ReactDOM.createPortal, then components involving Blueprint.Portals would be much easier to unit test via Enzyme, because Enzyme's wrapper methods (find, etc.) are now able to work across portal boundaries.

It may even simplify the implementation of Blueprint.Portal.

core breaking change

Most helpful comment

this will likely happen in 2.0, coming very soon!

All 4 comments

this will likely happen in 2.0, coming very soon!

2.0? 馃槂 By end of the year?

@kudigaracoder That's the goal, yep.

Good luck with the 2.0 update guys! Are you introducing new components?(that's not part of Labs)

Was this page helpful?
0 / 5 - 0 ratings