import _hashLink from './_hashLink';
import animateScroll from './scroll';
import React from 'react';

function _animateScroll(event, animate) {
  event.preventDefault();
  const hash = event.target.getAttribute('href');
  animateScroll(hash, animate);
}

export default function HashLink(props) {
  return <_hashLink {...props} animateScroll={_animateScroll} />;
}

import _hashLink from './_hashLink';
import animateScroll from './scroll';
import React from 'react';

function _animateScroll(event, animate) {
  event.preventDefault();
  const hash = event.target.hash;
  animateScroll(hash, animate);
}

export default function HashLink(props) {
  return <_hashLink {...props} animateScroll={_animateScroll} />;
}

Use hash attribute instead of full href
Use hash attribute instead of full href

Allow more than just the hash passed to the href attribute