React Scroll To Component.
npm install scroll-to-componentA React component to warp the aim component, and afford a scrollIntoView method to scroll aim component to visible area.
```
npm install scroll-to-component
or
yarn add scroll-to-component
---
`jsx
import React, { useRef } from 'react';
import ScrollToComponent from 'scroll-to-component';
export default () => {
const demo = useRef();
const scroll = () => {
const param = { behavior: 'smooth' };
demo.current.scrollIntoView(param);
};
return (
);
};
`
The param is same as origin scrollIntoView` in DOM element. Regard as MDN.