Call devFreeze on initialData (#2332)

I noticed we weren't freezing the initialData passed into the store.

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
David Sheldrick 2023-12-18 15:45:52 +00:00 committed by GitHub
parent ed153a4180
commit 509ee3a6e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,7 +187,10 @@ export class Store<R extends UnknownRecord = UnknownRecord, Props = unknown> {
objectMapFromEntries(
objectMapEntries(initialData).map(([id, record]) => [
id,
atom('atom:' + id, this.schema.validateRecord(this, record, 'initialize', null)),
atom(
'atom:' + id,
devFreeze(this.schema.validateRecord(this, record, 'initialize', null))
),
])
)
)