You will need to update primereact to a React 19 compatible version.
npm i primereact@latest
For context: Primereact probably uses fordwardRef to wrap some internal components. Refs can now be passed as a regular prop instead. The fordwardRef function will be removed in a future release.