-
-
Notifications
You must be signed in to change notification settings - Fork 130
feat(next): use react-query #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(next): use react-query #320
Conversation
malikalahfaoui
commented
Mar 14, 2022
Q | A |
---|---|
Branch? | main for features / current stable version branch for bug fixes |
Tickets | #... |
License | MIT |
Doc PR | api-platform/docs#... |
const delete{{{ucf}}} = async (id) => | ||
await fetch(id, { method: "DELETE" }); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Please remove one line.
const save = useMutation(save{{{ucf}}}); | ||
const deleteMutation = useMutation(()=> delete{{{ucf}}}(book["@id"]), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird to not have consistency for names and mutation function usage.
It probably lacks the usage of:
|
Why React Query and not SWR... or just nothing? |
Let's use react query then 👍 |
48354e7
to
0b97ef3
Compare
@@ -27,21 +30,22 @@ const Page: NextComponentType<NextPageContext, Props, Props> = (props) => { | |||
</div> | |||
<Show {{{lc}}}={ {{{lc}}} } text={ props.text } /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no props any more and text is not exposed as well from them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue is corrected on 319
e652731
to
3a7f1ac
Compare
f488445
to
baaf315
Compare
baaf315
to
ec38894
Compare
5df9912
to
42f4b2e
Compare
42f4b2e
to
6469fc1
Compare