diff --git a/.changeset/vast-emus-cheer.md b/.changeset/vast-emus-cheer.md new file mode 100644 index 000000000..ec13d0e52 --- /dev/null +++ b/.changeset/vast-emus-cheer.md @@ -0,0 +1,6 @@ +--- +"gitbook": patch +"@gitbook/embed": patch +--- + +Fix Embed options in React diff --git a/packages/embed/src/react/GitBookFrame.tsx b/packages/embed/src/react/GitBookFrame.tsx index b9f527fea..2a7f5b38b 100644 --- a/packages/embed/src/react/GitBookFrame.tsx +++ b/packages/embed/src/react/GitBookFrame.tsx @@ -11,13 +11,21 @@ import { useGitBook } from './GitBookProvider'; export type GitBookFrameProps = { className?: string; } & GetFrameURLOptions & - GitBookEmbeddableConfiguration; + Partial; /** * Render a frame with the GitBook Assistant in it. */ export function GitBookFrame(props: GitBookFrameProps) { - const { className, visitor, actions, greeting, suggestions, tools } = props; + const { + className, + visitor, + actions = [], + greeting, + suggestions = [], + tools = [], + tabs = ['assistant', 'docs'], + } = props; const frameRef = useRef(null); const gitbook = useGitBook(); @@ -33,13 +41,13 @@ export function GitBookFrame(props: GitBookFrameProps) { useEffect(() => { gitbookFrame?.configure({ - tabs: ['assistant', 'docs'], + tabs, actions, greeting, suggestions, tools, }); - }, [gitbookFrame, actions, greeting, suggestions, tools]); + }, [gitbookFrame, actions, greeting, suggestions, tools, tabs]); return (