Skip to content

Commit 3d31ebb

Browse files
committed
Fix hooks
1 parent d3bac8b commit 3d31ebb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

web/components/bio/profile-bio.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ export function ProfileBio(props: {
1515
}) {
1616
const {isCurrentUser, profile, refreshProfile, fromProfilePage} = props
1717
const [edit, setEdit] = useState(false)
18+
const editor = useTextEditor({defaultValue: ''})
19+
const [textLength, setTextLength] = useState(MAX_INT)
1820

1921
if (!isCurrentUser && !profile.bio) return null
2022
if (fromProfilePage && !profile.bio) return null
2123

22-
const editor = useTextEditor({defaultValue: ''})
23-
const [textLength, setTextLength] = useState(editor?.getText().length ?? MAX_INT)
24-
2524
useEffect(() => {
2625
if (!editor) return
2726
editor.commands.setContent(profile.bio as JSONContent)

0 commit comments

Comments
 (0)