Skip to content

Commit 07a03bf

Browse files
fix(UIView): Do not reload view if the new viewConfig is identical to the old one
1 parent 07608f3 commit 07a03bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/UIView.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,15 @@ export class UIView extends Component<UIViewProps, UIViewState> {
226226
/**
227227
* View config updated callback
228228
*
229-
* This is called by UI-Router when a state was activated, and one of its views targets this `UIView`
229+
* This is called by UI-Router during ViewService.sync().
230+
* The `newConfig` parameter will contain view configuration (component, etc) when a
231+
* state is activated and one of its views targets this `UIView`.
230232
*/
231233
viewConfigUpdated(newConfig: ReactViewConfig) {
234+
if (newConfig === this.uiViewData.config) {
235+
return;
236+
}
237+
232238
let newComponent =
233239
newConfig && newConfig.viewDecl && newConfig.viewDecl.component;
234240
let trans: Transition = undefined,

0 commit comments

Comments
 (0)