React.js w/ Laravel 10, Vite images do not load

119 Views Asked by At

I've searched around and can't find an answer for this:

My setup is Laravel 10, Vite, React.js

I'm trying to add an image, the source code gets outputted correctly; however, the image does not load.

This is my .jsx code

export default function ApplicationLogo(props) {
    const url = new URL('.', import.meta.url);
    const logoUrl = url.origin + '/resources/images/layout/my_logo.jpg';
    return (
         <div>
            <image src={logoUrl} alt={'My Logo'}></image>
         </div>
    );
}

The HTML Outputs correctly, and the image src is correct

<div>
   <image src="http://localhost:5173/resources/images/layout/my_logo.jpg" alt="My Logo"></image>
</div>

can someone please point me to the right direction. THANKS!!

0

There are 0 best solutions below