builder
builder copied to clipboard
builderContext is missing for Qwik
Describe the bug
In 0.14.27 builderContext
is missing for Qwik.
provideBuilderContext works only with React Server Components and with default components. Our logic rely on qwik and custom components. Basically we define a schema on model level and use it everywhere inside custom components.
To Reproduce
import type { RegisteredComponent } from '@builder.io/sdk-qwik'
import type { BuilderContextInterface } from '@builder.io/sdk-qwik/types/src/context/types'
const CustomComponent = component$<{
builderContext: BuilderContextInterface & {
content?: {
data?: {
foo: string
}
}
}
}>(({ builderContext }) => {
const data = builderContext.content?.data // 0.14.27 Exception builderContext -> undefined
if (!data) {
return null
}
return <div>{data.foo}</div>
})
export const CustomComponentBuilder: RegisteredComponent = {
component: CustomComponent,
name: 'Custom Component',
}
Is there any new way how to get fields from model inside custom components?