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

WIP: Refactor to use hooks and react-spring #82

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bridger
Copy link

@bridger bridger commented Sep 5, 2022

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!

@@ -93,12 +93,12 @@
"webpack-cli": "^3.3.10"
},
"peerDependencies": {
"react": "^15.0.1 || ^16.0.1",
"react-dom": "^15.0.1 || ^16.0.1"
"react": "^16.8",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably compatible with newer React too, but I'm not sure how to test that.

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 this pull request may close these issues.

None yet

1 participant