import React, { CSSProperties } from 'react'
import isElectron from 'is-electron'

interface ImageProps {
  src: string
  className?: string
  style?: CSSProperties
  alt?: string
}

const Image = ({ src, className, style, alt }: ImageProps) => {
  if (isElectron() && src.startsWith('/app')) {
    src = src.slice(1)
  }

  return <img src={src} className={className} style={style} alt={alt} />
}

export default Image

import React, { CSSProperties } from 'react'

interface ImageProps {
  src: string
  className?: string
  style?: CSSProperties
  alt?: string
}

const Image = ({ src, className, style, alt }: ImageProps) => {
  if (src.startsWith('/app')) {
    src = src.slice(1)
  }

  return <img src={src} className={className} style={style} alt={alt} />
}

export default Image

--- 
+++ 
@@ -1,4 +1,5 @@
 import React, { CSSProperties } from 'react'
+import isElectron from 'is-electron'
 
 interface ImageProps {
   src: string
@@ -8,7 +9,7 @@
 }
 
 const Image = ({ src, className, style, alt }: ImageProps) => {
-  if (src.startsWith('/app')) {
+  if (isElectron() && src.startsWith('/app')) {
     src = src.slice(1)
   }
 
Rewrite src for electron app only
