Booker atom needs a QueryClientProvider? #18936
Replies: 2 comments 3 replies
-
Hey @WilliamMayor! I'm a bot designed to help you solve bugs, answer questions, and become a contributor. Feel free to ask me anything while waiting for a human maintainer. To resolve the "No QueryClient set, use QueryClientProvider to set one" error when embedding the Booker atom in a non-React environment like a Python/Flask stack, you need to ensure that the import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
const queryClient = new QueryClient();
export function BookerApp() {
return (
<QueryClientProvider client={queryClient}>
<Booker
view="WEEK_VIEW"
eventSlug="hardcoded-for-now"
username="hardcoded-for-now"
onCreateBookingSuccess={() => {
console.log("booking created successfully");
}}
/>
</QueryClientProvider>
);
}
let container = document.getElementById("calcom-booker");
if (container) {
createRoot(container).render(
<StrictMode>
<BookerApp />
</StrictMode>,
);
} Ensure that the If you prefer not to use the Booker atom and want to explore standard embed options, you might consider using any available embed scripts or APIs provided by Cal.com that do not require React. However, specific details on these options are not available in the current context. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
Reading an issue on the TanStack/query repo[0] pointed me to maybe there being multiple versions of react or react-query, and this meant there were two contexts being used, one with the client provider I was creating, and one (the one the atom uses) without it. So I reinstalled everything, making sure to have only the version of react that atoms wants. This turns out to be Unfortunately, now my runtime error is this: Downgrading to react 18 proved to be difficult because of conflicting peer dependencies where react-dom insisted on having react 19. Eventually I got everything to agree, but that gave me the same error as before, presumably because I'd just added another version of react or react-query back in. So now I'm stuck again. I'm going to open an issue about using the |
Beta Was this translation helpful? Give feedback.
-
Hey. We're trying to add atoms to our Python/Flask stack, where we don't use react. We're not react developers, so we're finding it pretty rough in places.
The latest hurdle is that when we try to build an app that contains the Booker atom, we're seeing this error in the browser console:
Uncaught Error: No QueryClient set, use QueryClientProvider to set one
I've found some examples of how to add a query client, and I've now got to here:
But I still get the same error message.
The other atoms (that use the CalProvider) work just fine. We've managed to embed those into our site. It's just this booker one.
Does any one have any general tips for easy way to embed react components into a site without having to use react for routing etc? We don't want a full react SPA, we just want to attach react to a few divs in our existing site and have it add the atoms inside them.
Does anyone know anything about the query provider stuff?
Finally, is it possible to just use the standard embed options, that we would get if we weren't using Platform? Do we have to use the Booker atom?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions