MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / updateLoop

Function updateLoop

src/content/TextAnimations/FallingText/FallingText.jsx:136–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134 Render.run(render);
135
136 const updateLoop = () => {
137 wordBodies.forEach(({ body, elem }) => {
138 const { x, y } = body.position;
139 elem.style.left = `${x}px`;
140 elem.style.top = `${y}px`;
141 elem.style.transform = `translate(-50%, -50%) rotate(${body.angle}rad)`;
142 });
143 Matter.Engine.update(engine);
144 requestAnimationFrame(updateLoop);
145 };
146 updateLoop();
147
148 return () => {

Callers 1

FallingTextFunction · 0.70

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected