Skip to content

Commit

Permalink
fix(admin): fix invalid import in richtext
Browse files Browse the repository at this point in the history
  • Loading branch information
matej21 committed Jan 16, 2024
1 parent 7ddf4dd commit 98ad865
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createElement, ReactElement } from 'react'
import { createElement, isValidElement, ReactElement } from 'react'
import {
createEditor,
Descendant,
Expand Down Expand Up @@ -134,7 +134,7 @@ export const createEditorWithEssentials = (defaultElementType: string): Editor =
if (props.leaf[mark.type] === true) {
const markerEl = mark.render({ ...props, children: el })
if (markerEl !== null) {
if (!React.isValidElement(markerEl)) {
if (!isValidElement(markerEl)) {
throw new Error(`Mark plugin ${mark.type} returned a non-React element`)
}
el = markerEl
Expand Down

0 comments on commit 98ad865

Please sign in to comment.