diff --git a/packages/djs-editor/src/Editor.js b/packages/djs-editor/src/Editor.js index a4d00b4..59b16c0 100644 --- a/packages/djs-editor/src/Editor.js +++ b/packages/djs-editor/src/Editor.js @@ -2,4 +2,6 @@ import React from 'react' import Draft from 'draft-js' import { withConsumer } from './EditorContainer' -export default withConsumer(({ editorProps }) => ) +export default withConsumer( + React.forwardRef(({ editorProps }, ref) => ) +) diff --git a/packages/djs-editor/src/EditorContainer.js b/packages/djs-editor/src/EditorContainer.js index 75a41f4..5f419a0 100644 --- a/packages/djs-editor/src/EditorContainer.js +++ b/packages/djs-editor/src/EditorContainer.js @@ -9,9 +9,11 @@ const { CompositeDecorator, EditorState, getDefaultKeyBinding, DefaultDraftBlock export const Context = createContext({}) -export const withConsumer = Comp => props => ( - {contextProps => } -) +export const withConsumer = Comp => React.forwardRef((props, ref) => ( + + {contextProps => } + +)) const resolveDecorator = plugins => new CompositeDecorator( Array.from(plugins.values()).reduce((acc, plugin) => (