Skip to content

Commit

Permalink
Create neat-beds-unite.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori authored Aug 18, 2022
1 parent fc97ee4 commit acecb4c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .changeset/neat-beds-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"remix": minor
"@remix-run/cloudflare": minor
"@remix-run/deno": minor
"@remix-run/node": minor
"@remix-run/react": minor
"@remix-run/serve": minor
"@remix-run/server-runtime": minor
---

feat(@remix-run/cloudflare,@remix-run/deno,@remix-run/node): `SerializeFrom` utility for loader and action type inference

Each runtime package (@remix-run/cloudflare,@remix-run/deno,@remix-run/node) now exports `SerializeFrom`, which is used to
infer the JSON-serialized return type of loaders and actions.

Example:
```ts
type MyLoaderData = SerializeFrom<typeof loader>
type MyActionData = SerializeFrom<typeof action>
```
This is what `useLoaderData<typeof loader>` and `useActionData<typeof action>` use under-the-hood.

0 comments on commit acecb4c

Please sign in to comment.