From 5c3685f0c4945843bb56f310c93a9089783d5751 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 21 Aug 2023 11:30:53 -0700 Subject: [PATCH] remove unused file upload code (#1634) this code is no longer used, since file uploads are handled via state/hooks provided in the upload component itself. --- reflex/.templates/jinja/web/pages/index.js.jinja2 | 6 ------ reflex/compiler/utils.py | 5 ----- 2 files changed, 11 deletions(-) diff --git a/reflex/.templates/jinja/web/pages/index.js.jinja2 b/reflex/.templates/jinja/web/pages/index.js.jinja2 index dc3f774e5..ed19b5279 100644 --- a/reflex/.templates/jinja/web/pages/index.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/index.js.jinja2 @@ -13,12 +13,6 @@ export default function Component() { const { {{const.color_mode}}, {{const.toggle_color_mode}} } = {{const.use_color_mode}}() const focusRef = useRef(); - // Function to add new files to be uploaded. - const File = files => {{state_name|react_setter}}(state => ({ - ...state, - files, - })) - // Main event loop. const [Event, notConnected] = useContext(EventLoopContext) diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 9aa7c42ee..5a234668b 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -126,11 +126,6 @@ def compile_state(state: Type[State]) -> Dict: initial_state = state().dict() except Exception: initial_state = state().dict(include_computed=False) - initial_state.update( - { - "files": [], - } - ) return format.format_state(initial_state)