In which scenario is it NOT recommended to use ChangeDetectionStrategy.OnPush?

  • When a component has complex view logic with many nested components
  • When a component is stateful and has user interactions triggering updates
  • When a component relies on frequent data updates from external sources
  • When optimizing for performance is a top priority
ChangeDetectionStrategy.OnPush is not recommended when a component relies on frequent data updates from external sources because it can lead to manual triggering of change detection, reducing the benefits of this strategy. It's more suitable for components with infrequent updates or performance optimization.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *