Leocardoso94 / animated-number-react

Super easy way to animate numbers with React
MIT License
103 stars 13 forks source link

Fixed update state on unmounted component error. #20

Closed ErikParso closed 3 years ago

ErikParso commented 3 years ago
jfabellera commented 3 years ago

@Leocardoso94 any chance of this getting merged?

ErikParso commented 3 years ago

@jfabellera hi, not sure maybe in future. Try sa-animated-number-react while new version IS available. Its forked from this repo with fix

jfabellera commented 3 years ago

@ErikParso thanks! It's working great

ZilvinasKucinskas commented 3 years ago

Waiting for the new release as well. Thanks for sa-animated-number-react workaround.

elyobo commented 3 years ago

Thanks for your workaround @ErikParso.

I think my changes in https://github.com/Leocardoso94/animated-number-react/pull/28 are probably a better approach to resolving this, as it prevents the animation from running at all after unmount (which prevents the modification of state) instead of simply preventing the ongoing animation from attempting to modify state.

The additional changes to package.json and the addition of the GH action config files should ideally be kept in another branch in your own repo rather than in the PR, as the maintainer won't want them merged into this repo.

ErikParso commented 3 years ago

@elyobo it was just Quick fix to get rid of the error. After a long time not reviewing this PR by owner i decided to create own release because we needed fix in production. Anyway yours solution seems to be better and ill abandon this one. Hope it was tested as well.

This package seems to be dead and I personally suggest to find another one.

elyobo commented 3 years ago

Thanks @ErikParso - are you accepting PRs on your fork? I came here because my colleague started using yours and wanted to keep an eye on when the fix was merged upstream :)

ErikParso commented 3 years ago

@elyobo yes feel free to create PR in fork and ill deploy it

elyobo commented 3 years ago

Thanks, I'll get one up this evening.

elyobo commented 3 years ago

Added https://github.com/ErikParso/animated-number-react/pull/1