@astrojs/image with JSX #1296
Answered
by
delucis
outbackStack
asked this question in
Q&A
-
Is it possible to use astro Astro File - example from docs ---
import { Image } from '@astrojs/image/components';
import heroImage from '../assets/hero.png';
---
// optimized image, keeping the original width, height, and image format
<Image src={heroImage} /> Solidjs File - got an error saying it can't locate the import { Image } from '@astrojs/image/components';
import heroImage from '../assets/hero.png';
export function HeroComponent() {
return (
<Image src={heroImage} />
);
} |
Beta Was this translation helpful? Give feedback.
Answered by
delucis
Aug 18, 2022
Replies: 1 comment 1 reply
-
Hi @outbackStack — no the image component is a Do come join us on Discord if you’re looking for more support! https://astro.build/chat |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
outbackStack
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @outbackStack — no the image component is a
.astro
component so can only be used inside other.astro
components, I’m afraid.Do come join us on Discord if you’re looking for more support! https://astro.build/chat