Skip to content

Image import is not resolved yet #9

@xJkit

Description

@xJkit

Hi Andrie, I just read your post on medium recently about the SSR and Create-React-App without ejecting. It's awesome!

However, the following line of code confuses me:

<img src="./logo.svg" className="App-logo" alt="logo"/>

I think for the client-side-rendered react app, the image assets are imported and resolved by webpack loader:

import logo from './logo.svg';
// ...somewhere in the render method
<img src={logo} className="App-logo" alt="logo"/>

Accordingly, the original way does not fit your medium post. How would you resolve that kind of problem without adding extra webpack config on server-side or ejecting create-react-app?

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions