Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View component with useLifecycle doesn't run activate when VM being changed #49

Closed
kopecmi8 opened this issue Sep 30, 2021 · 1 comment · Fixed by #50
Closed

View component with useLifecycle doesn't run activate when VM being changed #49

kopecmi8 opened this issue Sep 30, 2021 · 1 comment · Fixed by #50

Comments

@kopecmi8
Copy link
Contributor

Due to refactor inside View component between versions 0.15.0 and 0.16.0 error occur when you try to update.

Consider for following code:

function renderViewModel(viewModel: any) {
  ReactDOM.render(<View vm={viewModel} useLifecycle />, document.getElementById("root"));
}

When you changes viewModel via prop at 0.15.0 activate callback run always. Now in 0.16.0 (and higher) activation callback run only when componentDidMount and doesn't run when VM being changed.

kopecmi8 pushed a commit to kopecmi8/frui.ts that referenced this issue Sep 30, 2021
@kopecmi8 kopecmi8 changed the title View component with useLifecycle doesn't run activate when VM changed View component with useLifecycle doesn't run activate when VM being changed Sep 30, 2021
kopecmi8 pushed a commit to kopecmi8/frui.ts that referenced this issue Sep 30, 2021
gius pushed a commit that referenced this issue Sep 30, 2021
…ed. (#50)

* #49 Run activate inside componentDidUpdate too when VM is being changed.

* #49 Better naming

Co-authored-by: Michal Kopecký <michal.kopeck@eman.cz>
@gius
Copy link
Contributor

gius commented Sep 30, 2021

Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants