Remix.run Logo
koakuma-chan 14 hours ago

Astro component is your page's entry point. It's similar to React server component. The typical flow is to fetch data in it, and pass the data to client component written in React or whatever. You can also have pages that are Astro only, without any front-end framework.

mpeg 14 hours ago | parent [-]

Yeah, I know, but since by default the front-end islands are server-rendered with no hydration the lines are blurred between what you would use an .astro component for, and just using for example react.

Personally I only ever use .astro components if I'm 100% sure I will never need any client side interactivity, otherwise it's just easier to ignore them.

koakuma-chan 14 hours ago | parent [-]

I mean, you have to have an .astro file if you want your route to be picked up, and then import and use React components in that file. IIRC, you cannot just directly use React.

mpeg 14 hours ago | parent [-]

Oh right, yeah I get what you're saying now. Indeed I think .astro templates make sense at the page level say to define a layout, and I actually like the syntax of stuffing the server js into a frontmatter style block, it's pretty nice.