No sé si la vista web de react-native admite esta funcionalidad, pero ¿puedo elegir y representar un div específico y no toda la página web?
Por ejemplo, si un sitio html contiene este segmento:
<html> <head> <title>Href Attribute Example</title> </head> <body> <h1>Href Attribute Example</h1> <p> <a href="https://www.theExample.com">The example page</a> shows you how and where you can contribute to solutions. </p> </body> </html>Pero solo quiero mostrar este segmento en la vista web
<h1>Href Attribute Example</h1> <p> <a href="https://www.theExample.com">The example page</a> shows you how and where you can contribute to solutions. </p>¿Cómo lo conectaría para que se renderice aquí?
return( <View> <WebView source={{ uri: 'https://www.theExample.com' }} />; </View> )¿Estás tratando de lograr algo como esto: renderizar html usando webview?
También eche un vistazo a esto: React native custom html render
Esta funcionalidad no es algo que se obtiene de la caja. Pero hay algunas opciones definitivamente.
Estas son las opciones que veo si controlas el código fuente de la página :
https://www.theExample.com?container=true ). Luego verifica la presencia del parámetro de consulta en la aplicación y muestra/oculta lo que necesita según esa condición.Estas son las opciones que veo si no controlas el código fuente de la página :
injectedJavaScript : <WebView source={{ uri: 'https://www.theExample.com' }} injectedJavaScript="window.alert('You can manipulate the DOM here')" />