Fix mention list not loading

This commit is contained in:
Sinclair Chen 2022-07-20 16:17:19 -07:00
parent 1e667bd9d8
commit c04e36e3fe

View File

@ -45,7 +45,8 @@ export function useTextEditor(props: {
'box-content min-h-[6em] textarea textarea-bordered text-base'
)
const editor = useEditor({
const editor = useEditor(
{
editorProps: { attributes: { class: editorClass } },
extensions: [
StarterKit.configure({
@ -130,7 +131,9 @@ export function useTextEditor(props: {
}),
],
content: defaultValue,
})
},
[!users.length] // passed as useEffect dependency. (re-render editor when users load, to update mention menu)
)
const upload = useUploadMutation(editor)