Images not loading from assets folder
edu81 opened this issue · comments
I am trying to use an image from assets folder like:
<img src={require('../assets/logo.svg')} alt="NONE"/>
The plugin UI is always displaying "NONE".
App.tsx is located in "components" folder while images are in "assets" folder, both folders on same level.
Any help here?
By writing it as require('../assets/logo.svg').default
, it worked.
add file ./src/types.d.ts
declare module '*.svg' {
const content: any;
export default content;
}
then import logo src like this
import logo from './logo.svg';
<img src={logo} />
Added built in SVG TS support
#34