How to consume API in Astro.
Thread ๐งต๐๐ป
Thread ๐งต๐๐ป
Astro is a relatively new static site generator that allows you to use your preferred JS framework.
Currently, the following frameworks are supported:
- React
- Svelte
- Vue
- Solid
- Preact
- Alpine
- Lit
- Vanilla JS
Currently, the following frameworks are supported:
- React
- Svelte
- Vue
- Solid
- Preact
- Alpine
- Lit
- Vanilla JS
The component script part is executed before the actual component is rendered.
We will use this part of the component to fetch data which will then be used in the template.
We will use this part of the component to fetch data which will then be used in the template.
We can assign returned data into the components' variable and access the variable right in the component template part.
In our case, the variable is called "post".
In our case, the variable is called "post".
Hope you enjoyed this short tutorial.
If you found this thread useful, follow @Rapid_API ๐๐
If you found this thread useful, follow @Rapid_API ๐๐
Loading suggestions...