React Native component - Images

Images component is used for displaying images in React Native. Rendering Images in React Native is slightly different from regular HTML and React. There are two ways to render images in React Native. Local images render and network images render.


1. Local Images 

To render Local images to your App. You first Import Image from React Component and use the Image tag in the component and use the require() function to give the path of the image as shown in the given picture.



Where the local path in the folder is inside the require() function.


2. Network Images

To render network images we use 'uri' method in the double middle brackets and put links inside the parenthesis as shown in the below image.





It's better to use local images in the favicon or icon. For the rest of the images in the apps, you could use network images.


Comments