Skip to content

Commit d01162a

Browse files
committed
feat(UIView): force component re-mount on reload()
BREAKING CHANGE: when a state is entered/exited the State Component is remounted, re-running its lifecycle methods. Closes #172
1 parent 7dfc87c commit d01162a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/UIView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ class View extends Component<UIViewProps, UIViewState> {
243243
}
244244

245245
this.uiViewData.config = newConfig;
246-
let props = { ...resolves, transition: trans };
246+
const key = Date.now();
247+
let props = { ...resolves, transition: trans, key };
247248

248249
let newComponent = newConfig && newConfig.viewDecl && newConfig.viewDecl.component;
249250
this.setState({

0 commit comments

Comments
 (0)