Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Throw new error when initial state is undefined #2461

Merged
merged 8 commits into from
Jun 27, 2022

Conversation

dannielss
Copy link
Contributor

Add a new error when initial state is undefined on createSlice.ts.

Issue: #2459

@dannielss dannielss changed the title Throw new error when initial state is undefined - #2459 Throw new error when initial state is undefined Jun 27, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 27, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 661dabd:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration

@netlify
Copy link

netlify bot commented Jun 27, 2022

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 661dabd
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/62b9af04ff4d0f0009868d33
😎 Deploy Preview https://deploy-preview-2461--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@dannielss
Copy link
Contributor Author

@markerikson it should be throw new error or console.error?

@markerikson
Copy link
Collaborator

Heh, sorry - I had assumed "throw", Lenz said "print a console error", so we'll go with Lenz's opinion here :)

@markerikson
Copy link
Collaborator

@dannielss : yeah, let's go with:

console.error('You must provide an `initialState` value that is not `undefined`.  You may have misspelled `initialState`')

@dannielss
Copy link
Contributor Author

Updated to console.error

@markerikson markerikson added this to the 1.9 milestone Jun 27, 2022
@markerikson
Copy link
Collaborator

Thanks! At a minimum this will end up going out in 1.9. If we end up doing a 1.8.x minor release before then, it'll be part of that first.

@markerikson markerikson merged commit 9e24958 into reduxjs:master Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants