I created a react app with React 18, but when I try installing reactGA using npm install react-ga --save, I get errors:

I tried reinstalling nodejs but nothing seems to be working, I can install other packages but for some reason react-ga is not working.
The error message says react-ga requires React 15, 16 or 17.
Downgrade your React version to 17. 18 was just released yesterday - the ecosystem hasn't caught up.