How to use the react-scroll.animateScroll.scrollToTop function in react-scroll

To help you get started, we’ve selected a few react-scroll examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github denisp107 / Shopmost / src / store / shared / app.js View on Github external
componentWillReceiveProps(nextProps) {
    this.props.setCurrentPage(nextProps.location);

    if (nextProps.location && this.props.location) {
      const pathnameChanged = nextProps.location.pathname !== this.props.location.pathname;
      const queryChanged = nextProps.location.search !== this.props.location.search;
      const isSearchPage = nextProps.location.pathname === '/search';

      if (pathnameChanged || (queryChanged && isSearchPage)) {
        animateScroll.scrollToTop({
          duration: 500,
          delay: 100,
          smooth: true
        });
      }
    }
  }
github yvanwangl / recatch-ui / src / containers / posts / components / PostView.tsx View on Github external
constructor(props: any) {
        super(props);
        //组件初始化滚动到顶部
        scroll.scrollToTop({
            duration: 700,
            delay: 0,
            smooth: "easeOutQuad"
        });
    }
github codica2 / react-app-best-practice / src / views / routes / index.js View on Github external
history.listen(location => {
      const param = getAllUrlParams(location.search).hash;
      if (!param)
        scroll.scrollToTop({
          duration: 0,
          delay: 0,
          smooth: false
        });
    });
github MicroBenz / YWC15-FrontEnd / pages / registration / index.js View on Github external
.then(() => {
                      routerNavigate(2);
                      animateScroll.scrollToTop();
                    })
                )}
github siriwatknp / mui-treasury / src / pages / Layout / LayoutBuilderPage.js View on Github external
const onNextStep = value => () => {
    const nextStep = step + value;
    scroll.scrollToTop(scrollConfig);
    setTimeout(() => {
      if (nextStep <= 4) {
        setScreen('xs');
      } else if (nextStep <= 8) {
        setScreen('sm');
      } else if (nextStep <= 12) {
        setScreen('md');
      }
      setStep(nextStep);
    }, 400);
  };
  return (
github microsoft / TailwindTraders-Website / Source / Tailwind.Traders.Web / ClientApp / src / pages / detail / detailContainer.js View on Github external
async componentDidMount() {
        scroll.scrollToTop();
        await this.getDetailPageData(this.props.match.params.productId);
    }
github MicroBenz / YWC15-FrontEnd / pages / registration / completed.js View on Github external
componentDidMount() {
    animateScroll.scrollToTop();
  }
  render() {