One thing to note here is that animation do not affect element before or after the keyframes.
In order to persist the styling based on last or first keyframe, we have animation-fill-mode
{ 14 / 19 }
It accepts following value
- forwards (element will retain last keyframe styling)
- backwards (element will get the first keyframe value even in animation-delay period)
- both (both of the above)
{ 15 / 19 }
Let's play with animation-fill-mode
As you can blue box stopped at left: 500px becuase forwards is begin applied on it
And orange box has black background even it's in a delay period of 2 seconds
useReducer is preferable to useState when you have some complex state.
It accepts three parameter out of which two are mandatory I guess
The first one is reducer function and second one is initial state
useReducer returns two things
- The first one in current state
- The second one is a dispatch function using which you can change your current state by passing action type is dispatch.
Some general tips for writing an effective tweet or thread
𧡠ππΌ
1οΈβ£ Write about the things you are good at
I always try to write tweets related to web technologies. More specifiy I try to cover CSS, JavaScript and React. By writing about the stuff that you're good, you can share huge amount of knowledge from your tweet
{ 2 / 10 }
2οΈβ£ Support your point with an example
If you're writing about some coding tips or tricks, It would be great if you give a example in the form of image, video, gif or link