Skip to content

Commit a4eb9c1

Browse files
authored
Merge branch 'master' into master
2 parents 4cf5b22 + 6a3b75b commit a4eb9c1

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/stale.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
daysUntilStale: 60
2+
daysUntilClose: 7
3+
exemptLabels:
4+
- pinned
5+
- security
6+
staleLabel: stale
7+
markComment: >
8+
This issue has been automatically marked as stale because it has not had
9+
recent activity. It will be closed if no further activity occurs. Thank you
10+
for your contributions.
11+
closeComment: false

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export class ReactTemplate<TContext extends object | void> extends React.Compone
6262

6363
componentDidUpdate() {
6464
// Context has changes, trigger change detection after pushing the new context in
65-
Object.assign(this._embeddedViewRef.context, this.props.context);
65+
if (this.props.context != null && this._embeddedViewRef.context != null) {
66+
Object.assign(this._embeddedViewRef.context, this.props.context);
67+
}
6668
this._embeddedViewRef.detectChanges();
6769
}
6870

@@ -86,9 +88,11 @@ export class ReactTemplate<TContext extends object | void> extends React.Compone
8688

8789
// Throttling the detect changes to an empirically selected value so we don't overload too much work.
8890
// TODO: This needs some better solution to listen to changes to the binding sources of the template.
89-
this._ngZoneSubscription = ngZone.onStable.pipe(throttleTime(TEMPLATE_DETECT_CHANGES_THROTTLE_MS)).subscribe(() => {
90-
this._embeddedViewRef.detectChanges();
91-
});
91+
this._ngZoneSubscription = ngZone.onStable
92+
.pipe(throttleTime(TEMPLATE_DETECT_CHANGES_THROTTLE_MS, undefined, { leading: true, trailing: true }))
93+
.subscribe(() => {
94+
this._embeddedViewRef.detectChanges();
95+
});
9296
}
9397

9498
componentWillUnmount() {

0 commit comments

Comments
 (0)