Skip to Content
Full-Stack React Projects - Second Edition
book

Full-Stack React Projects - Second Edition

by Shama Hoque
April 2020
Intermediate to advanced
716 pages
18h 55m
English
Packt Publishing
Content preview from Full-Stack React Projects - Second Edition

Animation with requestAnimationFrame

The rotation behavior for each 3D object is implemented in the event handlers added to the Entity component, which is rendering the 3D object. Specifically, in the rotate(index) and stopRotate() handler methods that are called when the onEnter and onExit events occur, we will implement rotation animation behavior using requestAnimationFrame for smooth animations in the browser.

The window.requestAnimationFrame() method asks the browser to call a specified callback function to update an animation before the next repaint. With requestAnimationFrame, the browser optimizes the animations to make them smoother and more resource-efficient.

Using the rotate method, we will update the rotateY transform value of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack React Projects

Full-Stack React Projects

Shama Hoque
React Native - The Practical Guide

React Native - The Practical Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839215414Supplemental Content