AdeleD / react-paginate

A ReactJS component that creates a pagination
MIT License
2.76k stars 628 forks source link

Accessing to ref #512

Open Edgar200021 opened 10 months ago

Edgar200021 commented 10 months ago

How can I access ref ? I need to put a mouseenter event handler on the button, but I can't because I don't have access to ref

stoyanov-kaloyan commented 9 months ago

You can achieve this by using the useRef hook as in this example:

const pageRef = useRef(null);

return (
    <ReactPaginate
    ref={pageRef}
    pageCount={pageCount}
    />)

Here is the reack useRef documentation