@@ -26,6 +26,7 @@ export interface WidgetData {
26
26
nodeHandler : NodeHandler ;
27
27
invalidate ?: Function ;
28
28
rendering : boolean ;
29
+ inputProperties : any ;
29
30
}
30
31
31
32
export interface BaseNodeWrapper {
@@ -752,7 +753,7 @@ export class Renderer {
752
753
let item : InvalidationQueueItem | undefined ;
753
754
while ( ( item = invalidationQueue . pop ( ) ) ) {
754
755
let { current, next } = item ;
755
- if ( previouslyRendered . indexOf ( next . instance ) === - 1 ) {
756
+ if ( previouslyRendered . indexOf ( next . instance ) === - 1 && this . _instanceToWrapperMap . has ( next . instance ! ) ) {
756
757
previouslyRendered . push ( next . instance ) ;
757
758
const sibling = this . _wrapperSiblingMap . get ( current ) ;
758
759
sibling && this . _wrapperSiblingMap . set ( next , sibling ) ;
@@ -854,21 +855,24 @@ export class Renderer {
854
855
}
855
856
856
857
private _queueInvalidation ( instance : WidgetBase ) : void {
857
- const current = this . _instanceToWrapperMap . get ( instance ) ! ;
858
- const next = {
859
- node : {
860
- type : WNODE ,
861
- widgetConstructor : instance . constructor as WidgetBaseConstructor ,
862
- properties : instance . properties ,
863
- children : instance . children
864
- } ,
865
- instance,
866
- depth : current . depth
867
- } ;
858
+ const current = this . _instanceToWrapperMap . get ( instance ) ;
859
+ if ( current ) {
860
+ const instanceData = widgetInstanceMap . get ( instance ) ! ;
861
+ const next = {
862
+ node : {
863
+ type : WNODE ,
864
+ widgetConstructor : instance . constructor as WidgetBaseConstructor ,
865
+ properties : instanceData . inputProperties ,
866
+ children : instance . children
867
+ } ,
868
+ instance,
869
+ depth : current . depth
870
+ } ;
868
871
869
- const parent = this . _parentWrapperMap . get ( current ) ! ;
870
- this . _parentWrapperMap . set ( next , parent ) ;
871
- this . _invalidationQueue . push ( { current, next } ) ;
872
+ const parent = this . _parentWrapperMap . get ( current ) ! ;
873
+ this . _parentWrapperMap . set ( next , parent ) ;
874
+ this . _invalidationQueue . push ( { current, next } ) ;
875
+ }
872
876
}
873
877
874
878
private _queueInRender ( item : RenderQueueItem ) {
@@ -1032,7 +1036,10 @@ export class Renderer {
1032
1036
1033
1037
private _updateWidget ( { current, next } : UpdateWidgetInstruction ) : ProcessResult {
1034
1038
const { instance, domNode, hasAnimations } = current ;
1035
- const instanceData = widgetInstanceMap . get ( instance ! ) ! ;
1039
+ if ( ! instance ) {
1040
+ return [ ] as ProcessResult ;
1041
+ }
1042
+ const instanceData = widgetInstanceMap . get ( instance ) ! ;
1036
1043
next . instance = instance ;
1037
1044
next . domNode = domNode ;
1038
1045
next . hasAnimations = hasAnimations ;
0 commit comments