We have declared the image path in the resourceImagePath prop and added the image to the resources object. However, the resources images are not rendering on the resources timeline. Kindly assist on this.
Kindly refer the attached screenshot for your reference.
Support Forum
There are several things to check:
- Take a look at Animations React demo.
resourceImagePath : 'users/'
is configured there. - Make sure that your images are copied in the correct folder - normally it should be a subfolder of
public
. - In some React apps you cannot traverse up with
../something/
- Check also resourceImageExtension - it should be empty string in your case.
- You can check in
Network
tab where the app is trying to load images from and correct potential wrong paths:
Hi Sukuna,
Thanks for providing the details. As Saki mentioned above:
1. Take a look at Animations React demo. resourceImagePath : 'users/' is configured there.
- Make sure that your images are copied in the correct folder - normally it should be a subfolder of public.
- In some React apps you cannot traverse up with ../something/
So that is what happening in your case. Please copy your images folder to public folder and set the correct path there.
It will be something like this:
resourceImagePath : 'images/'
I have made a small demo showing that in action. Please check this:
Hope this helps!
Regards,
Ghous
Hi Ghulam,
Right now our component setup is not a react app.Its basically a storybook setup which has no public folder or directory.As suggested by you and sagi,We have created a folder named images in our setup and tried importing the path using resourceImagePath
prop.Still we are not able to get over it.We are not able to proceed further on this and need your help to proceed further.Attaching the screenshots for further clarity.
Hi,
Can you please try sharing a small runnable test case with us so we can see where you can place your static resources in storybook? I was looking at the following link which shows how you can use static images etc inside storybook. https://storybook.js.org/docs/configure/images-and-assets. Maybe look at this and try it. There should be place in storybook from where you can serve your images just like we have /public
in react and /assets
in angular. Please also check this stackoverflow thread. https://stackoverflow.com/questions/58267903/serving-static-files-in-storybook-js. Best you should provide us with a small test so we can debug and assist you.
Regards,
Ghous
Hi Ghulam,
Placing the static images in public folder and accessing the images from there is fine.But what will happen if images are rendered from an api response and how we can handle at that point of time.For ex: extracting a bunch of profiles of employees to display in resource timeline.Provide your thoughts on this.
Hi prasath,
Is it abstract question or it's in a context of solution you shared with us previously? What do you mean by "rendered from an api"? Are we talking about absolute path to an image or something else?
Did you fix the initial problem you asked about?
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services