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

beforeUpdate / getSnapshotBeforeUpdate hook #15

Closed
alexkuhn opened this issue Apr 4, 2019 · 4 comments
Closed

beforeUpdate / getSnapshotBeforeUpdate hook #15

alexkuhn opened this issue Apr 4, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@alexkuhn
Copy link
Contributor

alexkuhn commented Apr 4, 2019

Would be nice to have a hook that is called before the DOM is patched on component re-render.

This is especially useful when dealing with scrollbar position.

@alexkuhn alexkuhn added the enhancement New feature or request label Apr 4, 2019
@alexkuhn alexkuhn changed the title getSnapshotBeforeUpdate / beforeUpdate hooks beforeUpdate / getSnapshotBeforeUpdate hook Apr 4, 2019
@alexkuhn
Copy link
Contributor Author

alexkuhn commented Apr 4, 2019

I think something like this should be good enough:
5635d45

@ged-odoo
Copy link
Contributor

ged-odoo commented Apr 5, 2019

@alexkuhn could you elaborate a little bit on this? Your use case is to save a scroll position before an update?

@alexkuhn
Copy link
Contributor Author

alexkuhn commented Apr 5, 2019

Indeed, beforeUpdate can be used to save the scroll position, so that it can be re-computed in componentDidUpdate.

@ged-odoo
Copy link
Contributor

ged-odoo commented Apr 5, 2019

closed. The method is now called willPatch.

@ged-odoo ged-odoo closed this as completed Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants