question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I access static file (like: js, css, .etc.)

See original GitHub issue

I’ve built a reactjs project and put the build folder into local device (IOS). In react native webview I put the path in source.

        <Webview
          ref={refWebview}
          source={{uri:`${RNFS.DocumentDirectoryPath}/build/index.html`}}
          onMessage={handleMessage}
          onLoadEnd={onLoadEnd}
          injectedJavaScript={sdk_js}
        />

But it don’t render anything because it can not access static folder. How can I fix it. THANKS.

Environment:

  • OS: IOS, ANDROID
  • react-native version: 0.64.0
  • react-native-webview version: 11.3.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

7reactions
tuan8797commented, Apr 29, 2021

thank you, I just found the solution. I fix it directly in native code.

0reactions
fukemycommented, Oct 7, 2022

thank you, I just found the solution. I fix it directly in native code.

plz share your solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to specify the path for static files (such as JS, CSS ...
I tried this. app.use(express.static('public'); It didn't work. Then, app.use(express.static(__dirname ...
Read more >
hapi — How to Serve Static Files (Images, JS, CSS, etc.)
This guide walks you through the setup of hapi to serve static files like images, JavaScript files, compressed archives ( .zip , .tar...
Read more >
Static files in ASP.NET Core | Microsoft Learn
Static files, such as HTML, CSS, images, and JavaScript, are assets an ASP.NET Core app serves directly to clients by default.
Read more >
Static Files with Express HTML, CSS, JavaScript #2 - YouTube
Interested in supporting this channel? Please use this link https://bit.ly/2Lfuf46Node. js : ...
Read more >
14. Serve the static files like CSS, JS using express ... - YouTube
In this video we will see how to serve the static files like CSS and JS files using express static method in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found