How to use the gatsby-remark-autolink-headers/gatsby-browser.shouldUpdateScroll.apply function in gatsby-remark-autolink-headers

To help you get started, we’ve selected a few gatsby-remark-autolink-headers 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 gaearon / overreacted.io / gatsby-browser.js View on Github external
}) {
  const { pathname, hash } = routerProps.location;
  if (prevRouterProps) {
    const {
      location: { pathname: oldPathname },
    } = prevRouterProps;
    if (shouldPreserveScrollBetween(oldPathname, pathname)) {
      return false;
    }
  } else {
    // Always forget scroll for first load.
    return [0, 0];
  }
  // Call it manually so we have a chance to preserve scroll the line before.
  // TODO: maybe inline whatever it does.
  return oldShouldUpdateScroll.apply(this, arguments);
};

gatsby-remark-autolink-headers

Gatsby plugin to autolink headers in markdown processed by Remark

MIT
Latest version published 2 days ago

Package Health Score

93 / 100
Full package analysis