I have been working on adjusting iframe height automatically.
The solutions with the problem are not working in React Hooks.
I have read Setting iframe height to scrollHeight in ReactJS and Adjust width and height of iframe to fit with content in it. I have explored additional posts and tried several times for almost a week. However, I have not found a proper way to figure this out.
I simplified what I have tried. My code
Apart from my code, I also tried iframeResizer.min.js
, yet it is not working. I believe it is because react generates dynamically. I found iframe-resizer-react
and tried but I have not found a way to solve it.
Can anybody have the same situation? How can I adjust iframe height automatically in React Hooks?