Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 authored Oct 30, 2024
2 parents 4ae99cf + d6e4caf commit 644b141
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/react/src/Context.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Editor } from '@tiptap/core'
import React, {
createContext, HTMLAttributes, ReactNode, useContext,
useMemo,
} from 'react'

import { EditorContent } from './EditorContent.js'
Expand Down Expand Up @@ -38,14 +37,13 @@ export function EditorProvider({
children, slotAfter, slotBefore, editorContainerProps = {}, ...editorOptions
}: EditorProviderProps) {
const editor = useEditor(editorOptions)
const editorContextValue = useMemo(() => ({ editor }), [editor])

if (!editor) {
return null
}

return (
<EditorContext.Provider value={editorContextValue}>
<EditorContext.Provider value={{ editor }}>
{slotBefore}
<EditorConsumer>
{({ editor: currentEditor }) => (
Expand Down

0 comments on commit 644b141

Please sign in to comment.