()
| 208 | // In this case we need the widget UI to synchronize with deck view states |
| 209 | // so we update deck props here and rerender DOM in the next onRedraw |
| 210 | updateHTML() { |
| 211 | if (!this.views) { |
| 212 | // viewLayouts has changed, re-evaluate |
| 213 | this.views = evaluateViews(this.viewLayouts[0]) as ViewsT; |
| 214 | // we send a copy to the callback so that externally set views can be differentiated from internal |
| 215 | this.props.onChange(this.views.slice() as ViewsT); |
| 216 | } |
| 217 | // This method is called inside deck.setProps > widgetManager.setProps > widget.setProps |
| 218 | // Calling deck.setProps immediately would cause infinite loop |
| 219 | requestAnimationFrame(() => { |
| 220 | this.doUpdate(); |
| 221 | }); |
| 222 | } |
| 223 | |
| 224 | private doUpdate() { |
| 225 | if (this.deck) { |
no test coverage detected