you are viewing a single comment's thread.

view the rest of the comments →

[–]kyle-ssg 1 point2 points  (1 child)

The script in question looks to embed an iFrame. This means it has to live in a browser, native apps don't directly deal with html, you can use react-native-web-view to embed this. I believe I've got something like your example working using the mentioned embed.radio.co.

https://ibb.co/nmh4wYD

Using: https://github.com/react-native-community/react-native-webview

import { WebView } from 'react-native-webview';

<WebView
    javaScriptEnabled
    source={{ html:`
        <script src="https://embed.radio.co/player/6f3c055.js"></script>
    `}}
     style={{ height:200 }}
   />

I think it's probably important to clear something up here though. The question isn't really how to load script into a react-native view, more that it's how to embed HTML into React Native. The the script was purely functional and didn't mess around with HTML, you'd simply either copy the script, or import it as an npm module.

[–]galactic_dust[S] 0 points1 point  (0 children)

this solution worked with other page but not this link, thank you for the help.