Is there a way to render HTML with react native expo for web?

2.3k views Asked by At

I know the web view works well for Android and IOS https://docs.expo.io/versions/latest/sdk/webview/. Although it is not available for web build of the expo as of now.

My use case is that I want to integrate a complete HTML based template in my expo web build for a specific screen with internal CSS and scripts.

I am open to other solutions and workarounds.

Thanks in Advance

2

There are 2 answers

0
mainak On

Render conditionally like Platform.os === 'android', show webview else render direct HTML. Simple..

2
Haseeb A On

In reality react native web uses react to render things. So

if(Platform.OS === "web"){
  <div></div> //etc or call a function that returns html
}else{
 ---- //Normal rendering
}