Skip to content

Commit

Permalink
docs: change useContext to useUtils (t3-oss#1733)
Browse files Browse the repository at this point in the history
  • Loading branch information
bent101 committed Jan 20, 2024
1 parent 5a9688f commit 9a34ba8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/src/pages/en/usage/trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Optimistic updates are when we update the UI before the API call has finished. T
const MyComponent = () => {
const listPostQuery = api.post.list.useQuery();

const utils = api.useContext();
const utils = api.useUtils();
const postCreate = api.post.create.useMutation({
async onMutate(newPost) {
// Cancel outgoing fetches (so they don't overwrite our optimistic update)
Expand Down

0 comments on commit 9a34ba8

Please sign in to comment.