How to make transition animation?
See original GitHub issueMy English is not good, so sorry~~~ 😢
In React ecosystem, I make a easy transition animation by ReactTransitionGroup
.
so, by Preact
, how i do it ?
I just want easy css transition animation,like enter or leave.
Thank you
preact
is awesome project, keep going! 👍
Issue Analytics
- State:
- Created 8 years ago
- Comments:23 (10 by maintainers)
Top Results From Across the Web
Using CSS transitions - CSS: Cascading Style Sheets | MDN
CSS transitions provide a way to control animation speed when changing CSS properties. Instead of having property changes take effect ...
Read more >Video: Animations and transitions - Microsoft Support
In the Thumbnail Pane, select the slide where you want to apply or change a transition. · On the Transitions tab, find the...
Read more >An Interactive Guide to CSS Transitions - Josh W Comeau
In this tutorial, we'll dig in and learn a bit more about CSS transitions, and how we can use them to create lush,...
Read more >Six Essential Motion Design Transitions
The Six Essential Motion Design Transitions · 1. HARD CUT · 2. DISSOLVE · 3. CUT ON ACTION · 4. MATCH CUT.
Read more >CSS Transitions - W3Schools
How to Use CSS Transitions? ... To create a transition effect, you must specify two things: ... Note: If the duration part is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was hoping to find something more in the vein of Preact - something more minimal and more general that doesn’t require the react compatibility thing.
Picodom offers two simple element-level life-cycle hooks,
oncreate
andonremove
:https://github.com/picodom/picodom#life-cycle-attributes
oncreate
is simple enough, and you can do something similar with theref
hook in Preact - butonremove
is particularly interesting here, because it permits you to defer the physical removal of the DOM element to a later time.So if you wanted animation during removal of keyed table-rows, you’d do something like this:
If the framework is about to remove a DOM element with an
onremove
handler, instead of immediately removing the element, it passes a callbackdone
to the handler, which can call it later to remove the actual element - in the mean time, the diff/patch algo ignores that element and leaves it where it is in the DOM.I’d love to find a simpler way to do something similar in Preact, as my needs are pretty humble - essentially, I’d use animation to indicate table-rows or list-items being added/removed, purely to improve end-user’s perception of having created/destroyed something.
If you were going to hard-code a simple removal animation, without any framework at all, what would that minimally look like in Preact?
For creation, if you’re going to use a simple CSS transition, presumably you’d need a “next frame” callback of sorts - some way to defer the addition of a class until the render after the next scheduled render. Is there any way to hook into the internal rendering pipeline of Preact to make that happen?
@neagle The issue is that
react-addons-css-transition-group
is actually just a proxy into React’s core. I’m working on a refactor/rewrite of rc-css-transition-group that improves it and makes it standalone. You can see how odd it is here:https://npmcdn.com/react-addons-css-transition-group