瀏覽代碼

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();
 
   // 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.
   let eventSent = false;