Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

default freeze on immer for perf #25438

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions shared/util/container.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import {type Draft as _Draft, setAutoFreeze} from 'immer'
import {type Draft as _Draft} from 'immer'
import type {TypedActions as _TypedActions} from '../actions/typed-actions-gen'
import type {ActionHandler as _ActionHandler} from './make-reducer'
import type {TypedState as _TypedState} from '../constants/reducer'
Expand All @@ -20,11 +20,6 @@ import USH from './use-selector'

const useSelector = USH.useSelector as TypedUseSelectorHook<RootState>

// don't pay for this in prod builds
if (!__DEV__) {
setAutoFreeze(false)
}

export const networkErrorCodes = [
StatusCode.scgenericapierror,
StatusCode.scapinetworkerror,
Expand Down