Changes in block schema customization properties
Sanity Studio v3.1 and later accept a component property on decorators and styles, which handles custom rendering of those types in the Portable Text input. Annotations are different: they read components.annotation instead, and a component property set on an annotation is ignored without a validation warning. Both properties replace blockEditor.render, which still works in v6 through a back-compatibility shim but is deprecated.
The icon property goes on the decorator, style, or annotation itself, as with all other schema types. This replaces the blockEditor.icon property.
So if you previously did this in your block type schema:
decorators: [
{
title: 'Highlight',
value: 'highlight',
blockEditor: {
icon: MarkerIcon,
render: highlightRender,
},
},
],You should now do this:
decorators: [
{
title: 'Highlight',
value: 'highlight',
icon: MarkerIcon,
component: Highlight,
},
],Read more about customizing the Portable Text Editor