blob: 486ecd327e6b041f64ec2b991ff791505c164552 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
---
'@astrojs/react': patch
'astro': patch
---
**BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
Make `.safe()` the default return value for actions. This means `{ data, error }` will be returned when calling an action directly. If you prefer to get the data while allowing errors to throw, chain the `.orThrow()` modifier.
```ts
import { actions } from 'astro:actions';
// Before
const { data, error } = await actions.like.safe();
// After
const { data, error } = await actions.like();
// Before
const newLikes = await actions.like();
// After
const newLikes = await actions.like.orThrow();
```
## Migration
To migrate your existing action calls:
- Remove `.safe` from existing _safe_ action calls
- Add `.orThrow` to existing _unsafe_ action calls
|