How to addressing dynamic image path in react

Hello

For loading a dynamic image I should give a path. How should I give the path dynamically?

const currentImage = React.UseContext(ImageContext);
return (
        <ImageContext.Consumer>
       
            <ImageEditor
                includeUI={{
                    loadImage: {
                        path: imageSrc,
                        name: "image",
                    },
         
        </ImageContext.Consumer>
    );

You can see here:

loadImage: {
        path: 'img/sampleImage.jpg',
        name: 'SampleImage'
      },

thanks,

Saeed