Experiments with High Performance Animation in React Native

Three major methods for shape animation with React Native via @salesforceeng

  • This story is my experience and experiments to achieve high performance animation in React Native.Along the way I learned tons from these blogs and recommend you read them as you dive deeper into building your own animations in React Native:React Native Animations Using Animated API from Nader DabitReact Native ART and D3 from Harry WolffBefore we continue, I would like to define what “high performance animation” in terms of my project.
  • Note: There is another OpenGL binding for React Native which enables a more flexible OpenGL implementation without the interface.Animation in React NativeIn my exploration I tested three major methods (with some variations) for doing shape animation with React Native.
  • For example, if we have a shape with a 1px border, it cannot be transformed to have a larger width/height and retain the same border width without redrawing.Experiments and ResultsRequest Animation Frame + JavaScript tweeningThe first approach is to change nothing but use the same code from the web implementation — meaning everything is done in JavaScript without any help from React Native.
  • The gaps between each country will also get scaled so the transformed shapes are not the same as the new shapes.Zoom animation with fade in/outThis method has a significant impact on the memory footprint since there are two views with a shadow node per shape.Animated + Hybrid Native Driver + Animated Shape (ART)For this approach I still used the Native Driver while I found there is a trick to communicate between the JS thread and UI thread using setNativeProps.
  • I first tried with React Native ART and switched to React Native SVG while both give similar results.Animated + Hybrid Native Driver + Animated Shape (OpenGL)After realizing the bottleneck comes from re-drawing shapes, I switched to another library which has the drawing logic implemented in OpenGL.

Archiving decent animation performance is quite tricky. This story is my experience and experiments to achieve high performance animation in React Native.
Continue reading “Experiments with High Performance Animation in React Native”

💰Black Friday Special 💸 2-for-1 Angular Developers 💻 Save Money 💵 Buy Now ☜

  • You probably found the page because one of our subscribers used MailChimp to send you an email campaign, and you traced a link in the email back to investigate.
  • We send more than 1 billion emails every day, and we help our customers comply with spam laws and best practices so they can get their campaigns into their subscribers’ inboxes.
  • MailChimp is an email-marketing service that serves more than 14 million companies of all shapes and sizes, from all over the world.
  • ______
  • / ___M ]__

Continue reading “💰Black Friday Special 💸 2-for-1 Angular Developers 💻 Save Money 💵 Buy Now ☜”

50% Off Summer Special: Bleeding Edge Books

  • You probably found the page because one of our subscribers used MailChimp to send you an email campaign, and you traced a link in the email back to investigate.
  • We send more than 1 billion emails every day, and we help our customers comply with spam laws and best practices so they can get their campaigns into their subscribers’ inboxes.
  • MailChimp is an email-marketing service that serves more than 12 million companies of all shapes and sizes, from all over the world.
  • MailChimp® is a registered trademark of The Rocket Science Group.
  • About / MCSV

Read the full article, click here.


@EdgePress: “End of summer special: enjoy 50% off many of our books: #redux #angular2 #reactjs #tensorflow #Docker #electronjs”


As summer is nearing the end
we are offering a sizzling special on many of our books.
Relax, enjoy what is left of summer, and get a great deal on us!


50% Off Summer Special: Bleeding Edge Books