Check out example codes for "Cannot find module '../../images/home.svg' or its corresponding type declarations". It will help you in understanding the concepts better.

Code Example 1

// custom.d.ts on root /

declare module '*.svg?inline' {
  const content: any
  export default content
}

declare module '*.svg' {
  const content: any
  export default content
}

Learn ReactJs, React Native from akashmittal.com