Skip to content

Conversation

niclas-j
Copy link
Contributor

@niclas-j niclas-j commented Apr 21, 2023

import { BlockNoteView, useBlockNote, defaultReactSlashMenuItems } from "@blocknote/react";
import "@blocknote/core/style.css";

function App() {
  const newSlashMenuItems: ReactSlashMenuItem[] = defaultReactSlashMenuItems;

  // Edit newSlashMenuItems
  ...

  const editor = useBlockNote({ slashMenuItems: newSlashMenuItems });

  return <BlockNoteView editor={editor} />;
}

Currently the example says:
const newSlashMenuItems: ReactSlashMenuItem[] = defaultSlashMenuItems;
leading to a type mismatch

 type 'BaseSlashMenuItem[]' is not assignable to type 'ReactSlashMenuItem[]'.
  Type 'BaseSlashMenuItem' is missing the following properties from type 'ReactSlashMenuItem': group, iconts(2322)

@vercel
Copy link

vercel bot commented Apr 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2023 0:36am
blocknote-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2023 0:36am

Copy link
Collaborator

@matthewlipski matthewlipski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@YousefED YousefED changed the title Use correct defaultItems in the React Slash Menu Example docs: Use correct defaultItems in the React Slash Menu Example May 8, 2023
@YousefED YousefED merged commit 4dc80ce into TypeCellOS:main May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants