GithubHelp home page GithubHelp logo

Independent Transitions about react-move HOT 27 CLOSED

sghall avatar sghall commented on May 21, 2024
Independent Transitions

from react-move.

Comments (27)

tannerlinsley avatar tannerlinsley commented on May 21, 2024 1

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

That seems more like react-motion's API and you are right, Items should act independently from one another. The changes would be or tremendous, but If you would like to sketch it out, I would be happy to work on it with you.

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

Technically speaking, I believe that an items progress should only reset when it's destination data changes via update. Does that sound right?

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Yes, that sounds spot on! It would be nice if an item's duration and easing only reset on data changes. too.

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Yep, that ticks all the boxes 👍

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

I’ve got my own navigation project that kinda takes up all my time - thanks for asking though. I’m in the process of swapping out React Motion for React Move in the React Native plugin.

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

Okay. I will get to it when I have some free time. Currently working a lot of react-table and react-charts.

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

Implemented in #16

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

This turned out to be a bit of a challenge, but I figured it out. Each item now maintains its own progress and invalidation. So now, if you interrupt a Transition with new updates, only items that need to change their destination will update, leaving any remaining items to finish their previous transition with their original timing.

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Thanks but I think it’s only halfway there. It fixed the first of my codepen examples but it’s broken the second one. Have a look at the weird behaviour of the second example to see what I mean

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

@grahammendick Its now fixed in 1.3.1 :) https://codepen.io/anon/pen/dWexMp?editors=0110

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Great work! Don't you need to do the same for the easing?

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

…. yeah haha.

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

Fixed. Along with some cool enhancements. You'll probably want to look at the newly created props getDuration and getEasing ;)

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Very classy! Thanks for doing such a great job.
I'll get back in touch when I release Navigation with React Move.

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Navigation is the data-first router. You concentrate on what data you want to pass and don’t worry about your routes until the end. Take a look at this counter example. There’s no URLs in sight, right? Just typed data - the count is passed as a number, not a string.

Once your app’s up and running you can change the URLs to be whatever you want without changing any code. In the counter example, you can change the count parameter from the query string to the route without touching the component (just set the route on line 18 to route: '{count?}').

The Navigation router gets out of your way. It doesn’t get involved in rendering. It’s almost the exact opposite of the React Router. The React Router is really just a rendering pattern and it provides almost no help with data-passing.

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Any reason you're not calling onRest in Transition component anymore? I was relying on it being called 😞

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

@grahammendick It's back now. Available for both Animate and Transition and finally documented :) Animate.onRest is simply a callback, but Transition.onRest will give you the item and its key that came to rest.

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Hmmm....onRest in Transition component is incorrectly called all the time now. It used to be behind a wasAnimating check so that it was only called when it really came to rest.

I think each item should have a wasAnimating flag on it, much like each one now has a duration and easing?

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Hey @tannerlinsley, just checking this onRest issue is still on your radar

from react-move.

tannerlinsley avatar tannerlinsley commented on May 21, 2024

from react-move.

grahammendick avatar grahammendick commented on May 21, 2024

Sorry, been away for a while. I've added an onRest with a console.log to the second example. It should only log twice, but it logs v many times instead.

from react-move.

Related Issues (20)

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.