From 28c31c2c0caf72e778ac43f1a519e4de75f036e2 Mon Sep 17 00:00:00 2001 From: Dylan Markow Date: Tue, 10 Dec 2019 22:58:40 -0600 Subject: [PATCH] Fix forced layout example (#3294) --- site/examples/forced-layout.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/examples/forced-layout.js b/site/examples/forced-layout.js index 700bfa6a1..2567cac52 100644 --- a/site/examples/forced-layout.js +++ b/site/examples/forced-layout.js @@ -1,12 +1,12 @@ import React, { useState, useCallback, useMemo } from 'react' import { Slate, Editable, withReact } from 'slate-react' -import { Editor, createEditor } from 'slate' +import { Editor, createEditor, Node } from 'slate' import { withHistory } from 'slate-history' const withLayout = editor => { const { normalizeNode } = editor - editor.normalizeNode = path => { + editor.normalizeNode = ([node, path]) => { if (path.length === 0) { if (editor.children.length < 1) { const title = { type: 'title', children: [{ text: 'Untitled' }] } @@ -27,7 +27,7 @@ const withLayout = editor => { } } - return normalizeNode(path) + return normalizeNode([node, path]) } return editor