Coder Social home page Coder Social logo

chipit24 / fade-props Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 2.0 65 KB

A ReactJS component that seamlessly fades between the props it is provided; it fades one child out, removes it, then fades the next child in.

License: ISC License

JavaScript 100.00%

fade-props's People

Contributors

chipit24 avatar dmchoull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fade-props's Issues

Breaks if children change happens too quickly

I have some code like this:

const children = loaded ? <Buttons key="buttons" /> : <Loader key="loader" />;
<FadeProps animationLength={500} children={children} />

When it switches from loaded=true to loaded=false then back to loaded=true too quickly (less than the animation time, roughly) the content fades out, but nothing fades in.

In this recording below when I click "Lets Go" it sets loaded=false which fades out the button and when the error "Name already taken" appears it sets loaded=true (before the button has finished fading out) but the button never fades back in (nor does the loader ever show up):

fade out no fade in

I need the buttons to either fade back in after they fade out, or (preferably) interrupt the fade out and fade back to 100% opacity.

For reference, if the change happens with enough time for the fades to complete it looks like this:

fade out and fade in

React 16 compatibility

Right now the package has hard dependency on specific version of React, meaning it fetches it's own copy, causing compatibility issues. Please consider adding version ranges instead.

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.