Преглед на файлове

state.js: do not shadow outer `state` var (#1375)

Masen Furer преди 1 година
родител
ревизия
915685c073
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      reflex/.templates/web/utils/state.js

+ 1 - 1
reflex/.templates/web/utils/state.js

@@ -222,7 +222,7 @@ export const processEvent = async (
   const event = state.events.shift();
   const event = state.events.shift();
 
 
   // Set new events to avoid reprocessing the same event.
   // Set new events to avoid reprocessing the same event.
-  setState(state => ({ ...state, events: state.events }));
+  setState(currentState => ({ ...currentState, events: state.events }));
 
 
   // Process events with handlers via REST and all others via websockets.
   // Process events with handlers via REST and all others via websockets.
   let eventSent = false;
   let eventSent = false;