Open OperationXen opened 5 years ago
I take it you've seen these yeah?
No, I was going to do it oldschool with CSS animations in classes and hook lifecycle methods to add the classes
Noooo! :)
Its a little more complex, but it does give me a degree more control. Should i create my own transition component instead?
Other people have done that for you. If you don't want to use the material ones, maybe try one of these;
https://github.com/reactjs/react-transition-group/ (3 million downloads a week) https://github.com/react-spring/react-spring (100k downloads a week) https://github.com/FormidableLabs/react-animations (10k a week) https://popmotion.io/pose/ (80k downloads a week)
The transition-group one is actually documented in the official docs; https://reactjs.org/docs/animation.html
It is of course totally possible and acceptable to just use CSS though. If you just want simple fades/grows/slides though just use the material ones.
I have a natural reluctance to installing additional libs, I dislike having loads of dependencies.
Perhaps javascript development is not for me
That is a really healthy attitude - you should always treat the installation of a new npm module as a big deal (that's why I put npm downloads per week - that's a really good indicator as to whether to proceed or not from a vulnerability point of view).
That said - the JS community is very modular, and people do tend to build smaller things (unlike the python/ruby community where people tend to build very big things). If you want to see evidence of this, take a look in your node_modules
folder and I'll bet it's already into the hundreds of modules :)
It is not unusual for a JS project of any significant size to have a few dozen dependencies or even more. It's about finding that sweet spot between avoiding-if-possible and not-reinventing-the-wheel. For a few twiddly animations, probably not, but if animation is going to be a massive part of your UI then I think adding a new dependency is fine.
Add swipe animations to login / register widgets and grow on initial draw of categories