Skip to content

Commit e86caf4

Browse files
committed
refactor: console.error message
1 parent d99b8ee commit e86caf4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/toolkit/src/createSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export function createSlice<
268268
process.env.NODE_ENV === 'development'
269269
) {
270270
if(options.initialState === undefined) {
271-
console.error('initial state must be different of undefined')
271+
console.error('You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`')
272272
}
273273
}
274274

packages/toolkit/src/tests/createSlice.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('createSlice', () => {
5353
initialState: undefined,
5454
})
5555

56-
expect(getLog().log).toBe('initial state must be different of undefined')
56+
expect(getLog().log).toBe('You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`')
5757
})
5858
})
5959

0 commit comments

Comments
 (0)