Giter Club home page Giter Club logo

Comments (6)

fisshy avatar fisshy commented on September 25, 2024

Are you using "animate-scroll"?

from react-scroll.

marciovicente avatar marciovicente commented on September 25, 2024

@fisshy I'm using scroller..

import { scroller } from 'react-scroll';
// [...]
scroller.scrollTo([...])

from react-scroll.

fisshy avatar fisshy commented on September 25, 2024

Checkout the README

var Scroll = require('react-scroll');
var scroll = Scroll.animateScroll;
scroll.scrollTo(100, options);

I should probably make the API a bit more convenient, It can be confusing now.

from react-scroll.

fisshy avatar fisshy commented on September 25, 2024

Looks like scrollTo('element') doesn't match scrollTo('px'). I might fix this later today.

from react-scroll.

marciovicente avatar marciovicente commented on September 25, 2024

Sorry, but I don't get it... There are two scrollTo, right? animateScroll.scrollTo and scroller.scrollTo. The first accept the unit in pixels and the second expect an element.
Maybe my question is not clear.. my hashTarget variable is a Element..

<Element name="myElement"> [...] </Element>

import { scroller } from 'react-scroll';
scroller.scrollTo('myElement', {... args});

You might to use something like this in the future:

scroller.scrollToElement('myElement', {});
srollAnimate.scrollTo(100, {});

from react-scroll.

fisshy avatar fisshy commented on September 25, 2024

yes you are right and both should go under the "scrollAnimate" to not confused.
One was meant as the public API and one was used internally but I guess you can use both outside as well.

from react-scroll.

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.