diff --git a/package.json b/package.json index 6def92653e6e..6007ef6bb7fa 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand", "perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure", "typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc", - "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=216 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=215 --cache --cache-location=node_modules/.cache/eslint", "lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index a8fc974c3e79..2bf034773831 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -43,8 +43,10 @@ Onyx.connect({ }, }); +// `isSidebarLoaded` is only used inside the event handler, not during render. +// `useOnyx` would trigger extra rerenders without affecting the View, so `Onyx.connectWithoutView` is used instead let isSidebarLoaded: boolean | undefined; -Onyx.connect({ +Onyx.connectWithoutView({ key: ONYXKEYS.IS_SIDEBAR_LOADED, callback: (val) => (isSidebarLoaded = val), initWithStoredValues: false,