Skip to content

Commit

Permalink
fix(react): check props.clientRect before creating ReactRenderer (#4138)
Browse files Browse the repository at this point in the history
* moved validation to top of function
* fixed
  • Loading branch information
hariacharya80 committed Jul 7, 2023
1 parent 7e38c0f commit d710846
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions demos/src/Examples/Community/React/suggestion.js
Expand Up @@ -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,
Expand Down

0 comments on commit d710846

Please sign in to comment.