This npm package will do what you what, it offers a range of different ways to calculate the height of the content in the iframe
https://www.npmjs.com/package/iframe-resizer-react
With this use case it can be configured as follows