docs
docs copied to clipboard
Missing docs for `Astro.callAction` in `guides/actions`
📚 Subject area/topic
Actions
📋 Suggested page
https://docs.astro.build/en/guides/actions/
📋 General description or bullet points (if proposing new content)
There are completely missing docs (on this page) for correct calls from server-side Astro component.
If we call it from Astro component with actions.getGreeting
instead of Astro.callAction(...)
, the context is non-existing.
I was just scratching my head for a few minutes until I found out the correct way.
// ❌ Wrong
await actions.getGreeting({ name: "Bob" });
// ✅ Correct
await Astro.callAction(actions.getGreeting, { name: "Bob" });
🖥️ Reproduction of code samples in StackBlitz
No response