Answer the question
In order to leave comments, you need to log in
How to remove blinking buttons?
I am making an application on React and when developing the navBar there was such a problem that the icons blink when changing from active to inactive
This is logical, because I have a boolean property, depending on which I change the path to the icon
<img src={IsAcitve ? activeIncon : icon} />
Tell me how to solve this problem?
SVG Icons
Answer the question
In order to leave comments, you need to log in
Use the icon not in the directory but in the sprite.
1) Create a sprite with all icons
2) When accessing the first icon, the entire sprite will go into the cache and blinking will disappear
PS: I can give an example from the Angular application, the logic will be the same
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question