-
Notifications
You must be signed in to change notification settings - Fork 38
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
updated branch with hooks of pack screens #399
base: andrew_testing
Are you sure you want to change the base?
Conversation
Your Render PR Server URL is https://packrat-dev-pr-399.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-ckadcfugtj9c738tibg0. |
client/app/_layout.js
Outdated
|
||
export default function HomeLayout() { | ||
const queryClient = new QueryClient() |
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.
we should move this to to its own TrpcQueryProvider context just for cleaner code
Your Render PR Server at https://packrat-dev-pr-399.onrender.com is now live! View it on your dashboard at https://dashboard.render.com/web/srv-ckadcfugtj9c738tibg0. |
client/hooks/packs.js
Outdated
|
||
export const useAddNewPack = () => { | ||
// console.log(obj); | ||
const mutation = queryTrpc.addPack.useMutation(); |
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.
is this standard naming practice for react query custom hooks? genuine question i'm not sure
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.
We should at the very least be destructuring isLoading and error from the react query responses. To make it more like the redux store
client/hooks/packs.js
Outdated
let isLoading = true; | ||
switch (feedType) { | ||
case 'public': | ||
const publicPacks = queryTrpc.getPublicPacks.useQuery({ queryBy:queryString ? queryString: 'Favorite' }, { |
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.
We should at the very least be destructuring isLoading and error from the react query responses. To make it more like the redux store
client/components/pack/AddPack.js
Outdated
@@ -28,7 +28,7 @@ export const AddPack = () => { | |||
const error = useSelector((state) => state.packs.error); | |||
|
|||
const isError = error !== null; | |||
|
|||
const { mutation } = useAddNewPack() |
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.
naming convention
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.
overall good just clarifying a few things
Uncaught Error |
Trpc react query
updated the search into packs and get single trip and fetch global items
client/hooks/weather.js
Outdated
refetchOnWindowFocus: false, | ||
keepPreviousData: true, | ||
}); | ||
const isOwner = data && user && data.owner_id === user._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.
user is undefined here, maybe we should use our matches current user hook for this ?
…PackRat into trpc-react-query
No description provided.