GithubHelp home page GithubHelp logo

Comments (8)

jacobangel avatar jacobangel commented on June 7, 2024 3

You can add them by object spread, or manually:

import { presets, RouteTransition } from 'react-router-transition';

<RouteTransition {...preset.slideRight}>  .. </RouteTransition>

// OR 

<RouteTransition
  atEnter={preset.slideRight.atEnter} 
  atLeave={preset.slideRight.atLeave} 
  atActive={preset.slideRight.atActive} 
>  .. </RouteTransition>

from react-router-transition.

maisano avatar maisano commented on June 7, 2024 2

@ADavidLiu – it depends on which version of this library you're using. The most recent version of the API removed all presets from the library.

from react-router-transition.

maisano avatar maisano commented on June 7, 2024

the presets should be accessible from the top-level module, e.g.

import { presets } from 'react-router-transition';

and while react-motion is a dependency of this project, we don't export it anywhere. if you wanted to set different attributes for custom transitions, you don't need to use react-motion directly–you would just define the properties in the atEnter, atLeave, etc.

from react-router-transition.

kennetpostigo avatar kennetpostigo commented on June 7, 2024

@maisano thank you for the reply, How to I activate the presets in the transition component? So far I have atEnter, atLeave, `atActive, not sure how to split the preset up to put into these props. I tried looking at the demo and I couldn't quite understand it.

from react-router-transition.

kennetpostigo avatar kennetpostigo commented on June 7, 2024

@jacobangel Thank you!

from react-router-transition.

uxlayouts avatar uxlayouts commented on June 7, 2024

I'm getting: 'preset' is not defined no-undef
Also don't you still need path=""?

from react-router-transition.

maisano avatar maisano commented on June 7, 2024

@uxlayouts have you imported them from the react-router-transition package? and yes, on the latest version you still need a pathname prop–this will change very soon however.

from react-router-transition.

ADavidLiu avatar ADavidLiu commented on June 7, 2024

Is this still valid? I'm getting Attempted import error: 'presets' is not exported from 'react-router-transition'.

How can I access these so I don't have to create custom style animations?

from react-router-transition.

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.