Skip to content

Commit a7b754a

Browse files
authored
Update part6d.md import @tanstack/react-query vs 'react-query'
Following example code in the text needs to be updated from: import {XXX} from 'react-query' to import {XXX} from '@tanstack/react-query' Indeed the library to be installed at the beginning of the chapter is now npm install @tanstack/react-query, and so throwing an error when trying to import 'react-query'. CF: documentation on https://www.npmjs.com/package/react-query 'Starting with v4, react-query is now available as @tanstack/react-query'
1 parent 58188a9 commit a7b754a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/6/en/part6d.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const getNotes = () =>
141141
The <i>App</i> component is now slightly simplified
142142

143143
```js
144-
import { useQuery } from 'react-query'
144+
import { useQuery } from '@tanstack/react-query'
145145
import { getNotes } from './requests' // highlight-line
146146

147147
const App = () => {
@@ -179,7 +179,7 @@ export const createNote = newNote => // highlight-line
179179
The <i>App</i> component will change as follows
180180

181181
```js
182-
import { useQuery, useMutation } from 'react-query' // highlight-line
182+
import { useQuery, useMutation } from '@tanstack/react-query' // highlight-line
183183
import { getNotes, createNote } from './requests' // highlight-line
184184

185185
const App = () => {
@@ -218,7 +218,7 @@ In order to render a new note as well, we need to tell React Query that the old
218218
Fortunately, invalidation is easy, it can be done by defining the appropriate <i>onSuccess</i> callback function to the mutation:
219219

220220
```js
221-
import { useQuery, useMutation, useQueryClient } from 'react-query' // highlight-line
221+
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query' // highlight-line
222222
import { getNotes, createNote } from './requests'
223223

224224
const App = () => {
@@ -253,7 +253,7 @@ export const updateNote = updatedNote =>
253253
Updating the note is also done by mutation. The <i>App</i> component expands as follows:
254254

255255
```js
256-
import { useQuery, useMutation, useQueryClient } from 'react-query'
256+
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
257257
import { getNotes, createNote, updateNote } from './requests' // highlight-line
258258

259259
const App = () => {

0 commit comments

Comments
 (0)