Search code examples
javascriptiframesolid-js

How to use iframe component in solidjs?


I would like to insert an iframe in my solidjs application. For this I downloaded the iframe package . But it rather created a bug in my application. Here is the code of my iframe:

import Iframe from 'iframe'
export default function SearchEngine() {
    return (

    <div>
          <Iframe src="http://gkwhelps.herokuapp.com"  width="100%" height="657px" />
     </div>

    )

}

I would like to know how to insert an iframe in solidjs. I wonder if there is a module like react-iframe for solidjs.


Solution

  • I'm not aware of any special package for inserting iframes for solid. But do you need some special features that react-iframe provided, or is it simply to have an iframe HTML element on the page?

    Because you can just use lowercase <iframe> element normally, and build any additional functionality you need on top of it.

    export default function SearchEngine() {
       return (
          <div>
             <iframe src="http://gkwhelps.herokuapp.com"  width="100%" height="657px"/>
          </div>
       )
    }
    

    Playground demo