Closed softmarshmallow closed 2 days ago
You should be able to do this by just removing the table block from the schema, as it bundles all supporting nodes with it:
const { table, ...remainingSpecs } = defaultBlockSpecs;
const schema = BlockNoteSchema.create({
blockSpecs: remainingSpecs,
});
const editor = useCreateBlockNote({
schema,
});
Great ! that works. although, when I set schema, I'm not able to set initialContent
- Simply ts-ignore it?
Ah yeah, probably your initialContent
also needs a type argument. Normally, when you have the type Block[]
for initialContent
, it uses the default block schema. But since you're now using a modified schema, you should give it the appropriate type argument:
const { table, ...remainingSpecs } = defaultBlockSpecs;
const schema = BlockNoteSchema.create({
blockSpecs: remainingSpecs,
});
const initialContent: Block<typeof schema.blockSchema>[] = [];
const editor = useCreateBlockNote({
schema,
initialContent,
});
return <BlockNoteView editor={editor} />;
Cannot find a doc athttps://www.blocknotejs.org/docs, I cannot find a way to disable the table extension.
Above will throw error