'How to extract image from its relevant path

if I have a folder of images in that folder I've saved the image of (xyz.png) and I want to use that image in some ".js" file and that file resides in another folder. Screens folder (parent folder) inside this there is a file "Patientheader.js" if I am using this command it does not lead me to that image source={require('../images/xyz.png')}

and if I am using this command this also creates error. source={require('.../images/xyz.png')}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source