Skip to content

Commit

Permalink
Update src/pages/[platform]/build-a-backend/data/query-data/index.mdx
Browse files Browse the repository at this point in the history
Co-authored-by: josef <[email protected]>
  • Loading branch information
chrisbonifacio and josefaidt authored Dec 17, 2024
1 parent 3fa3f03 commit e3ad85f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ When using TypeScript, you frequently need to specify data model types for type

<InlineFilter filters={["react", "javascript", "nextjs", "react-native"]}>

For instance, with React's `useState`, you provide a type in TypeScript to ensure type-safety in your component code using the state. Use the `Schema["MODEL_NAME"]["type"]` pattern to get TypeScript types for the shapes of data models returned from the backend API. This allows you to get consumable TypeScript types for the shapes of the data model return values coming from the backend API.
For instance, with React's `useState`, you provide a type in TypeScript to ensure type-safety in your component code using the state. Use the `Schema["MODEL_NAME"]["type"]` pattern to get TypeScript types for the shapes of data models returned from the backend API.

```ts
import { type Schema } from '@/amplify/data/resource';
Expand Down

0 comments on commit e3ad85f

Please sign in to comment.