search

Home  >  Q&A  >  body text

Use local css and js to load local HTML in React Native Webview

I want to load local html, css, js files in my React Native WebView but I can't load the css applied to the html, please see my folder structure

Above is my html as well as css images and js files, I put everything into my app folder structure like below

src --> html --> demo --> Paste all the above files into the image below %E

P粉642436282P粉642436282275 days ago452

reply all(1)I'll reply

  • P粉329425839

    P粉3294258392024-03-27 17:28:22

    You have to put the html and css files in the android_asset folder in the android folder, and for the ios folder, put it in resources in the ios folder.

    if(isAndroid){
      return (
          
      )
    }else{
      return(
        
      );
    }

    More references come from: WebView Html loaded from local

    reply
    0
  • Cancelreply