How to integrate Matomo with React Class based Component

I am trying to integrate Matomo with React using [matomo-tracker-react library]( The component is a Class based component and instruction on library’s page uses useMatomo hook. I looked around in react docs and figured out that it is not possible to use hooks with Class based components. Is there any way to add tracking snippet to the project or any work around for the library?

Thank you!

If you have no answer on the forum, maybe you can try on the GitHub repo: