Skip to content

getIn behavior changed in v4.0.0-rc.7? null items will spawn a warning and future error? #1372

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

Closed
chrisnojima opened this issue Oct 10, 2017 · 1 comment

Comments

@chrisnojima
Copy link

Hi,

I'm attempting to upgrade to 4.0.0 and ran into this issue. I use getIn() to get to nested values simply without having to do a bunch of chained get() calls. In v4 I notice if an object within the keyPath is null it'll complain

v3

> I.Record({foo: null})().getIn(['foo', 'bar'], 'test')
'test'

v4

> I.Record({foo: null})().getIn(['foo', 'bar'], 'test')
Invalid keyPath: Value at ["foo"] does not have a .get() method: null
This warning will throw in a future version
'test'

Is this expected or is this actually an ok use of getIn() (I hope so)

Thanks!

@leebyron
Copy link
Collaborator

Merging into #1361

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

No branches or pull requests

2 participants