Repository: https://github.com/Vlad160/scaling-rive
The issue is in the repository. The window resizes nicely the React component unless you click the "Toggle" button and remount it.
After that resizing stops working.
Extracting Rive animation fully to another component without conditional rendering fixes the issue.