The documentation shows how to import a static SVG file, however I am not able to get it working with a PNG file.
I am not sure what format I need to provide the image in. I have tried raw bytes, base64, and am not getting any results.
Please advise and ideally update the documentation to show how to handle different kinds of file formats for static assets if they require different data.
<Sandpack
files={{
"/public/image.png": "", // What do I provide here?
"/App.js": `export default function App() {
return (
<>
<h1>Hello React</h1>
<img width="100" src="/public/image.png" />
</>
);
}
`,
}}
options={{
experimental_enableServiceWorker: true,
}}
template="react"
/>
The documentation shows how to import a static SVG file, however I am not able to get it working with a PNG file.
I am not sure what format I need to provide the image in. I have tried raw bytes, base64, and am not getting any results.
Please advise and ideally update the documentation to show how to handle different kinds of file formats for static assets if they require different data.