You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Immutable v4 introduced a bug in getIn (and other methods as well, like hasIn) where attempting to continue on a list of keys after a null value was found would result in a deprecation warning. However, per discussion in #1161 this is not intended.
How to reproduce
constDB=Immutable.fromJS({users: [{name: 'Kyle',pets: null}]});functiongetUserPet(userIndex,petIndex){returnDB.getIn(['users',userIndex,'pets',petIndex,'name'],'no pet');}getUserPet(0,0);// throws warning -- Value at ["users",0,"pets"] does not have a .get() method: null
Expected although pets is null, the expected functionality would be that the getIn request will not throw a warning, but rather continue the v3 functionality.
What happened
Immutable v4 introduced a bug in
getIn
(and other methods as well, likehasIn
) where attempting to continue on a list of keys after anull
value was found would result in a deprecation warning. However, per discussion in #1161 this is not intended.How to reproduce
Expected although
pets
is null, the expected functionality would be that thegetIn
request will not throw a warning, but rather continue the v3 functionality.See also: https://codepen.io/Pink401k/pen/NayNPp
The text was updated successfully, but these errors were encountered: