fix(react): check props.clientRect before creating ReactRenderer (#4138)

* moved validation to top of function
* fixed
This commit is contained in:
Hari Acharya 2023-07-07 18:53:18 +05:45 committed by GitHub
parent 7e38c0fa0a
commit d710846ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,15 +16,16 @@ export default {
return {
onStart: props => {
reactRenderer = new ReactRenderer(MentionList, {
props,
editor: props.editor,
})
if (!props.clientRect) {
return
}
reactRenderer = new ReactRenderer(MentionList, {
props,
editor: props.editor,
})
popup = tippy('body', {
getReferenceClientRect: props.clientRect,
appendTo: () => document.body,