Setting iframe height to scrollHeight in ReactJS

后端 未结 5 495
隐瞒了意图╮
隐瞒了意图╮ 2021-01-02 07:24
  • The typical solution to the problem doesn\'t work in in React due to its dynamically generated component structure and event model, as opposed to traditional static HT
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-02 07:42

    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

    
    

提交回复
热议问题