fix resetFields

This commit is contained in:
Tom
2023-04-25 22:07:33 +02:00
parent 610ea65c67
commit 9f6a5d8e60
4 changed files with 42 additions and 14 deletions
+9 -3
View File
@@ -87,9 +87,15 @@ const ReplyModal = ({ isOpen, closeModal }) => {
const resetFields = () => {
nameRef.current.value = '';
commentRef.current.value = '';
linkRef.current.value = '';
if (nameRef.current) {
nameRef.current.value = '';
}
if (commentRef.current) {
commentRef.current.value = '';
}
if (linkRef.current) {
linkRef.current.value = '';
}
};
+12 -4
View File
@@ -211,10 +211,18 @@ const Board = () => {
const resetFields = () => {
nameRef.current.value = '';
subjectRef.current.value = '';
commentRef.current.value = '';
linkRef.current.value = '';
if (nameRef.current) {
nameRef.current.value = '';
}
if (subjectRef.current) {
subjectRef.current.value = '';
}
if (commentRef.current) {
commentRef.current.value = '';
}
if (linkRef.current) {
linkRef.current.value = '';
}
};
+12 -4
View File
@@ -137,10 +137,18 @@ const Catalog = () => {
const resetFields = () => {
nameRef.current.value = '';
subjectRef.current.value = '';
commentRef.current.value = '';
linkRef.current.value = '';
if (nameRef.current) {
nameRef.current.value = '';
}
if (subjectRef.current) {
subjectRef.current.value = '';
}
if (commentRef.current) {
commentRef.current.value = '';
}
if (linkRef.current) {
linkRef.current.value = '';
}
};
+9 -3
View File
@@ -171,9 +171,15 @@ const Thread = () => {
const resetFields = () => {
nameRef.current.value = '';
commentRef.current.value = '';
linkRef.current.value = '';
if (nameRef.current) {
nameRef.current.value = '';
}
if (commentRef.current) {
commentRef.current.value = '';
}
if (linkRef.current) {
linkRef.current.value = '';
}
};