Big shift: use mask + css gradient instead of SVG Animation #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The current approach uses a mix of masking, SVG-LinearGradient and SVG-Animation, but it always seems slower (more in #125) than other alternatives like CSS gradient + CSS animations. Also, SVG doesn't provide the best API possible to handle even with the small changes, like the interval between animation. But on another hand, CSS animation is an amazing solution for animations and how to handle it.
The biggest advantages I can see here about this new approach:
Otherwise, assuming that the new approach needs to render somehow a style tag - in order to set the animation - it needs to use the
dangerouslySetInnerHTML
prop or even a third-party to set in the head scope (which would be the worst case).Other disadvantages:
Any Breaking Changes
TODO
The following props were deprecated:
How to test