reactjsreact-nativeiframe

How to use Iframe in react native?


I tried to find a way to add iframe to my react native app. I found react-iframe, but it didn't work for me. I followed the documentation. I just imported react-iframe and copied the iframe tag to use.

My result is like the image below.

enter image description here

I need another way to use iframe in react native app. Thank you.


Solution

  • I answer on my question.

    I used webview for display Iframe.

    <WebView
       source={{html: '<iframe width="100%" height="50%" src="https://www.youtube.com/embed/cqyziA30whE" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'}}
       style={{marginTop: 20}}
    />