-
Notifications
You must be signed in to change notification settings - Fork 117
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
Export useQueryClient
from @contentful/field-editor-reference
#1808
Comments
export react-query client instance together with SharedQueryClientProvider to allow cache invalidation, cache setting, as well as reusing existing cache for entities fetching ✅ Closes: contentful#1808
import React, { useEffect, useState } from 'react'; const EntryTitleUpdater = ({ entryId, newTitle }) => { useEffect(() => {
}, [newTitle, entryId, queryClient]); return ( Entry Title Updater{isUpdating ? 'Updating title in cache...' : 'Title updated successfully!'} ); }; export default EntryTitleUpdater; You can please try this. Thanks. Happy Coding :) |
Hi @ManasiRoy that was the first thing I have tried, but unfortunately is not exported from this package. Only provider is, you can find it here https://github.com/contentful/field-editors/blob/master/packages/reference/src/index.tsx#L26 |
It would be great to have access to client instance itself on top of
SharedQueryClientProvider
to be able to invalidate or set data to cache storage from the app code, because right now it is pretty hard to update entry title in case it was modified externally.The text was updated successfully, but these errors were encountered: