react-spring icon indicating copy to clipboard operation
react-spring copied to clipboard

Performance Issue on Safari (Mobile & Web)

Open zurez opened this issue 5 years ago • 8 comments

🐛 Bug Report

The following example is very laggy while running on safari , though it is very smooth on Chrome Android

To Reproduce

https://codesandbox.io/embed/j0y0vpz59 Steps to reproduce the behavior: View the above url on iOS

zurez avatar Jul 16 '20 12:07 zurez

I have the same issue, the performance into chrome is perfect but thats not the case with Safari its lagging, when the parent state is too large more and more lagging it would be

kldnajjar avatar Nov 20 '20 12:11 kldnajjar

I had the same problem in Safari and the problem was in the transition: transform 0.1s; for the animated element

art-smi avatar Feb 12 '21 13:02 art-smi

Same issue in non dom renderers like https://reactpixi.org and https://github.com/konvajs/react-konva, using "@react-spring/core": "9.1.1" to get useSpring

Not sure if it's helpful, but using https://greensock.com/gsap on same renderers doesn't seem to cause performance issues.

xzilja avatar Apr 15 '21 16:04 xzilja

Same issue in non dom renderers like https://reactpixi.org and https://github.com/konvajs/react-konva, using "@react-spring/core": "9.1.1" to get useSpring

Not sure if it's helpful, but using https://greensock.com/gsap on same renderers doesn't seem to cause performance issues.

If you can provide an example repro that'd be great. I've never used Konva before

joshuaellis avatar Apr 15 '21 17:04 joshuaellis

Looking at the attached sandbox, this SO question might be related.

Unfortunately, I can't recreate this issue without a physical Apple device to investigate.

CodyJasonBennett avatar Apr 28 '21 12:04 CodyJasonBennett

Got the same issue with react-konva on both Mac and Windows when upgrading from v8 to v9. Not sure if the issue with react-konva is related to the originally reported issue. The performance degradation seems to start with version 9. Codesandbox with a simple react-konva animation using version 8, very smooth: https://codesandbox.io/s/react-springkonva-performance-issue-v8-d4q8l

Codesandbox with a simple react-konva animation using version 9, performance is noticeably worse: https://codesandbox.io/s/react-springkonva-performance-issue-v9-v0b9u

Obi-Dann avatar Jun 15 '21 23:06 Obi-Dann

Looking at the attached sandbox, this SO question might be related.

Unfortunately, I can't recreate this issue without a physical Apple device to investigate.

The linked stackoverflow answer resolved the issue for me. It happened with both desktop and mobile Safari with the latest [email protected]. Adding transform: translate3d(0%,0,0); to the animated element made it a smooth animation like on chrome.

alexkrkn avatar May 08 '23 18:05 alexkrkn

Looking at the attached sandbox, this SO question might be related. Unfortunately, I can't recreate this issue without a physical Apple device to investigate.

The linked stackoverflow answer resolved the issue for me. It happened with both desktop and mobile Safari with the latest [email protected]. Adding transform: translate3d(0%,0,0); to the animated element made it a smooth animation like on chrome.

Nice yeah can confirm this still works and solved my problem as well.

Just went from

    <animated.div 
      style={{
        ...fade,
      }}
    >
      {children}
    </animated.div>

to

    <animated.div
      style={{
        transform: "translate3d(0, 0, 0)", // Just added this
        ...fade,
      }}
    >
      {children}
    </animated.div>

sidpremkumar avatar Feb 26 '24 01:02 sidpremkumar