Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Cannot use resources folder in cljs. #253

Open
zendevil opened this issue Mar 19, 2020 · 3 comments
Open

Cannot use resources folder in cljs. #253

zendevil opened this issue Mar 19, 2020 · 3 comments

Comments

@zendevil
Copy link

I have an app created using Chestnut, and there's an image in the project in the location: resources/public/img.png.
I want to use this image in my app, but doing [:img {:src "public/img.png"}] or [:img {:src "./img.png"}] doesn't work. What's the correct src for the image in the resources folder?

@featheredtoast
Copy link
Collaborator

Should be accessible by /img.png - the public folder is considered a resources folder, hosted from the root of your app.

@zendevil
Copy link
Author

[:img {:src "/img.png"}] doesn't work for me. How can I debug this?

@featheredtoast
Copy link
Collaborator

It's working for me, under the default (reagent) setup... What react wrapper are you using?

Can you confirm that you can access the image at localhost:10555/img.png?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants