Skip to content

Commit f2bb5b1

Browse files
Ben Grynhausbengry
authored andcommitted
Change ReactTemplate to do detectChanges, since markForCheck didn't work
1 parent 94e7123 commit f2bb5b1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libs/core/src/lib/renderer/react-template.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ export class ReactTemplate<TContext extends object | void> extends React.Compone
8686

8787
// Throttling the detect changes to an empirically selected value so we don't overload too much work.
8888
// TODO: This needs some better solution to listen to changes to the binding sources of the template.
89-
this._ngZoneSubscription = ngZone.onUnstable
90-
.pipe(throttleTime(TEMPLATE_DETECT_CHANGES_THROTTLE_MS))
91-
.subscribe(() => {
92-
this._embeddedViewRef.markForCheck();
93-
});
89+
this._ngZoneSubscription = ngZone.onStable.pipe(throttleTime(TEMPLATE_DETECT_CHANGES_THROTTLE_MS)).subscribe(() => {
90+
this._embeddedViewRef.detectChanges();
91+
});
9492
}
9593

9694
componentWillUnmount() {

0 commit comments

Comments
 (0)