WIP: Refactor to use hooks and react-spring #82
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.
This is a pretty big change, so I wanted to show it even as it is a work-in-progress. There are a few "todos" remaining.
It seems that react-motion isn't maintained anymore and is going to cause issues (#59). react-spring is a well maintained alternative, so I decided to rewrite using that.
I mistakenly thought react-spring only had a hooks API, so I rewrote TextLoop as a function component using hooks. I was wrong about react-spring (it does have a non-hooks API), but I am happy with the result anyway!
This is a big enough change it probably warrants a version bump. If you'd like, we can merge this into a more experimental branch first.
One change I'm worried about is that the state passed to the
onChange
callback has changed somewhat. That is likely a breaking change. I'm not sure if I should go out of the way to make it fit the exact format as before or if it is okay to change.I haven't ever published code to an npm package, so I may have missed something obvious. Let me know if there are any steps I'm missing to get this over the finish line!