-
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
Add support for @contentful/app-sdk #575
Comments
I experience the same issue but found a way to get around it. So until it's properly fixed, you can maybe try that. In stead of using the import { MultipleEntryReferenceEditor } from '@contentful/field-editor-reference';
// ...
const Field = (props: FieldProps) => {
// If you only want to extend Contentful's default editing experience
// reuse Contentful's editor components
// -> https://www.contentful.com/developers/docs/extensibility/field-editors/
const { sdk } = props
const sdkCast: any = sdk as any;
return (
<MultipleEntryReferenceEditor
isInitiallyDisabled={false}
hasCardEditActions={true}
sdk={sdkCast}
viewType='link'
parameters={{
instance: {
showCreateEntityAction: true,
showLinkEntityAction: true,
},
}}
></MultipleEntryReferenceEditor>
);
}; |
Thanks @caroillemann. Now it is showing some errors in index.tsx. The app works fine without the MultipleReferenceEditor component. src/index.tsx
src/components/EntryEditor.tsx
This is the example I am trying to implement with @contentful/app-sdk and @contentful/forma-36-react-components |
All field editors were updated to use |
@suevalov if I run What is the way to fix this? |
In case anyone comes across this bug as well you can hack a solution together from entry editor sdk like so
|
Hi @tonyneel923, do you know if there is an official solution for getting access to the fieldsdk from then entrysdk ? Or do we still need this workaround? |
Why is this closed? Is it solved yet? |
I am working on creating an entry editor for some content model. I am using @contentful/app-sdk and @contentful/forma-36-react-components. I am able to have the UI the way I want with the forma-36 components but I also want to use @contentful/field-editor-reference to have access to the original functionality of the field.
The problem I am running into is when I pass sdk to the MultipleEntryReferenceEditor component from @contentful/field-editor-reference. I get the following error
Type ‘import("/node_modules/@contentful/app-sdk/dist/types").FieldExtensionSDK’ is not assignable to type ‘import("/node_modules/contentful-ui-extensions-sdk/dist/types").FieldExtensionSDK’.
I believe Contentful recommends using @contentful/app-sdk over contentful-ui-extensions-sdk but @contentful/field-editor-reference has a transient dependency on contentful-ui-extensions-sdk.
The text was updated successfully, but these errors were encountered: