Error in <Content> component when integrating with Qwik
Has anyone got this error : cannot find react in the line where there is :<Content in the following code: import { component$ } from "@builder.io/qwik"; import { routeLoader$ } from "@builder.io/qwik-city"; import { fetchOneEntry, Content } from "@builder.io/sdk-qwik";
// Define Builder's public API key and content model. // TO DO: Replace with your Public API Key export const BUILDER_PUBLIC_API_KEY = YOUR_PUBLIC_API_KEY; export const BUILDER_MODEL = "page";
// Define a route loader function that loads // content from Builder based on the URL. export const useBuilderContent = routeLoader$(async ({ url, error }) => { // Fetch content for the specified model using the API key. const builderContent = await fetchOneEntry({ model: BUILDER_MODEL, apiKey: BUILDER_PUBLIC_API_KEY, });
// Return the fetched content. return builderContent; });
// Define a component that renders Builder content
// using Qwik's Content component.
export default component$(() => {
// Call the useBuilderContent function to get the content.
const content = useBuilderContent();
// Specify the content model, pass the fetched content,
// and provide the Public API Key
return (
<Content
model={BUILDER_MODEL}
content={content.value}
apiKey={BUILDER_PUBLIC_API_KEY}
/>
);
});
Could you format your issue better and add some more info? It's hard to understand as is.
Closing this due to inactivity. Feel free to create a new issue with proper reproduction and context.