Skip to content

Commit

Permalink
fix: react controlled state change
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace committed Nov 7, 2024
1 parent 0051d83 commit 3a40bea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/_components/_admin/admin-blog-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Props = Partial<{
export default function AdminBlogForm({ id, title, tag, content, cover, draft = false }: Props) {
const [state, action, isPending] = useActionState(adminBlogSubmit, undefined);

const [contentState, setContentState] = useState(content);
const [contentState, setContentState] = useState(content ?? '');
const [showCoverClearBtn, setShowCoverClearBtn] = useState(false);

const inputRef = useRef<HTMLInputElement | null>(null);
Expand Down

0 comments on commit 3a40bea

Please sign in to comment.