componentZone top-level property

  1. @visibleForTesting
Zone componentZone
getter/setter pair

The zone in which React will call component lifecycle methods.

This can be used to sync a test's zone and React's component zone, ensuring that component prop callbacks and lifecycle method output all occurs within the same zone as the test.

Example:

test('zone test', () {
  componentZone = Zone.current;

  // ... test your component
}

Implementation

@visibleForTesting
Zone componentZone = Zone.root;