Skip to content

Commit 628b33b

Browse files
committed
Update readme
1 parent d011076 commit 628b33b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { NavHashLink as NavLink } from 'react-router-hash-link';
4040
```
4141

4242
### Scrolling API
43-
`smooth: boolean`
43+
#### `smooth: boolean`
4444
- Smooth scroll to the element
4545
- React Router Hash Link uses the native Element method `element.scrollIntoView()` for scrolling, and when the `smooth` prop is present it will call it with the smooth option, `element.scrollIntoView({ behavior: 'smooth' })`
4646
- Note that not all browsers have implemented options for `scrollIntoView` - see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) and [Can I Use](https://caniuse.com/#feat=scrollintoview) - there is also a browser [polyfill for smooth scrolling](https://github.com/iamdustan/smoothscroll) which you can install separately so `smooth` will work in all browsers
@@ -49,7 +49,7 @@ import { HashLink as Link } from 'react-router-hash-link';
4949
<Link smooth to="/path#hash">Link to Hash Fragment</Link>
5050
```
5151

52-
`scroll: function`
52+
#### `scroll: function`
5353
- Custom scroll function called with the element to scroll to, e.g. `const myScrollFn = element => {...}`
5454
- This allows you to do things like scroll with offset, use a specific smooth scrolling library, or pass in your own options to `scrollIntoView`
5555
```js

0 commit comments

Comments
 (0)