瀏覽代碼

Bugfix for hidden refs (#1418)

Elijah Ahianyo 1 年之前
父節點
當前提交
5eeb560238
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      reflex/.templates/web/utils/state.js

+ 3 - 0
reflex/.templates/web/utils/state.js

@@ -383,6 +383,9 @@ export const preventDefault = (event) => {
  * @returns The value.
  */
 export const getRefValue = (ref) => {
+  if (!ref || !ref.current){
+    return;
+  }
   if (ref.current.type == "checkbox") {
     return ref.current.checked;
   } else {