Browse Source

Bugfix for hidden refs (#1418)

Elijah Ahianyo 1 year ago
parent
commit
5eeb560238
1 changed files with 3 additions and 0 deletions
  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.
  * @returns The value.
  */
  */
 export const getRefValue = (ref) => {
 export const getRefValue = (ref) => {
+  if (!ref || !ref.current){
+    return;
+  }
   if (ref.current.type == "checkbox") {
   if (ref.current.type == "checkbox") {
     return ref.current.checked;
     return ref.current.checked;
   } else {
   } else {