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.

ERROR calling Images from public folder

See original GitHub issue

I want to know how to acess the public folder inside react to use images from map.

Check out the project structure:

I have pass the values from src to public, it’s now inside public folder

This is my process to get URL to concat URL file:

<img src={"./category_images/".concat(categorie.file_path)} alt="" class="img-responsive" />

I’m getting Failed to load resource: the server responded with a status of 404 (Not Found)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Timercommented, Jan 5, 2018

Please follow the issue template then and provide us with a reproducable demo so we can look at what you’re doing wrong; thanks!

1reaction
Timercommented, Jan 4, 2018

You should find this guide sufficient. If not, let us know and we can re-open this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React import images from public folder - Stack Overflow
The import using file-loader works, but I need to access the source directly from the public path like <img src='/static/images/image.png'></img> ...
Read more >
4.1.0.14 - Adding Images - LearnHowToProgram.com
In this lesson, we'll cover adding static assets such as images to a React application that uses create-react-app . You aren't required to...
Read more >
HTML and Static Assets - Vue CLI
Any static assets placed in the public folder will simply be copied and not go through webpack. You need to reference them using...
Read more >
Using the Public Folder - Create React App
The public folder contains the HTML file so you can tweak it, for example, to set the page title. The <script> tag with...
Read more >
Images - React Native
Images live in the same folder as your JavaScript code. ... Sometimes, you might be getting encoded image data from a REST API...
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