restaurantPassport | a restaurant directory , an AirBnB of restaurants | Runtime Evironment library
kandi X-RAY | restaurantPassport Summary
kandi X-RAY | restaurantPassport Summary
a restaurant directory, an AirBnB of restaurants. Review, rate and book a restaurant
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of restaurantPassport
restaurantPassport Key Features
restaurantPassport Examples and Code Snippets
Community Discussions
Trending Discussions on restaurantPassport
QUESTION
I have an array of object, with each object having an imageUrl property, but when I loop through this array to display all images, the image doesn't get rendered
I loop through the array and pass the attribute housing the image link to the image src
...ANSWER
Answered 2019-Jul-02 at 16:54You can't use a relative path that points to somewhere in your project directory. Usual practice is to copy your images during your build process into a known folder in your output directory and then access them via /knownfolder/filename.png
- the leading slash makes the path relative to the root of your app.
It isn't enough to just remove the ..
as your running app can't access your project folders at run-time.
As you are using create-react-app
, you have (at least) two choices: 1) import the images using import
or 2) Put them in your /public
folder and use the PUBLIC_URL
variable.
The first approach looks like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install restaurantPassport
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page