Open
Conversation
Owner
|
Great! Will look into it, otherwise we will release it as 1.8 with breaking changes, it's time to upgrade it anyway. |
|
@fisshy why hasn't this been merged yet? Been over a year and a half |
Owner
I think I began working on a hook-first approach but ended up not doing it, and now its been forgotten until you woke it up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed i issue #430, the animateScroll module isn't working when it's called in a useEffect hook on the component mount.
It's a better approach to create a hook to fix that problem instead of relying on the need of creating a ref to verify if the tree has loaded, and then execute the effect with the animateScroll method.
The hook will return a ref that will be used as the scroll container, and behind the scenes it will take care of calling it inside of a useEffect call
We must discuss some points here, this library uses the version
^16.0.0of React, and hooks only are supported from version16.8onwards.I upgraded React to
16.13.1, but we have to think if it's going to lead to some kind of breaking changes in other projects.Also, I added a babel plugin to support spread operator.