Giter VIP home page Giter VIP logo

Comments (6)

sixmoraltales avatar sixmoraltales commented on June 25, 2024

I think the problem is related to processor overhead. I have a list containing up to 10 Typewriter text blocks, and they all begin animating on load. If I load fewer items, the speed is faster, but even with only 10 TypeWriter items in the list the view barely approaches the 5-10ms speed I hardcoded. Is it normal for this fairly simple animation to cause so much processor lag? I have an equivalent animation working in iOS (native) and it has no lag whatsoever...

Any tips for optimizing for speed? I have tried using FlatList, and it doesn't improve performance.

from react-native-typewriter.

sixmoraltales avatar sixmoraltales commented on June 25, 2024

Also tried with Pure Components, but makes no difference.

from react-native-typewriter.

TaylorBriggs avatar TaylorBriggs commented on June 25, 2024

Hey @sixmoraltales thanks for writing this up. It makes sense to me that there wouldn't be much of any visible effect on the typing at that low of a threshold.

You may have found a bug in the way the component is rendering, though. I wouldn't expect it to consume so much processor. It's also not using any of the animation framework React Native provides, just setState and slicing of the component's children. If you have time to look into it and want to open up a PR it will be very welcome!

from react-native-typewriter.

sixmoraltales avatar sixmoraltales commented on June 25, 2024

@TaylorBriggs Yeah, I'll keep looking into it. Think it might just be RN though. Going to try a paginated list to see if it speeds things up.

from react-native-typewriter.

sixmoraltales avatar sixmoraltales commented on June 25, 2024

@TaylorBriggs Seems it's not a bug, but simply a limitation of doing animations with .setState calls. I'll have to take another approach if I want to invoke multiple instances. Thanks!

from react-native-typewriter.

TaylorBriggs avatar TaylorBriggs commented on June 25, 2024

I'm going to close this for now. Please feel free to re-open or open a PR if you have an alternative solution. Thanks!

from react-native-typewriter.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.