I tried to add our first mapOf test, which failed. While mapOf(ImmutablePropTypes.record) fails, I can pass mapContains with the same data. Yes, I checked wheter there are any non-records in the map - there are none.
Example:
const StackRecord = Record({
nodeId: null,
}, 'stack');
const myMap = Map(
['root', StackRecord({})],
['other', StackRecord({})],
['more', StackRecord({})],
);
// fails when tested against
ImmutablePropTypes.mapOf(ImmutablePropTypes.record).isRequired,
// passes
ImmutablePropTypes.mapContains({
root: ImmutablePropTypes.record.isRequired,
}).isRequired
When I put the Records in a List instead, it works fine with listOf(ImmutablePropTypes.record).
It's just mapOf that fails with the following message (library is the name of the property I check).
Invalid argument 'library[0]' of type 'array' supplied to 'Nav', expected 'Record'
I tried to add our first mapOf test, which failed. While
mapOf(ImmutablePropTypes.record)fails, I can passmapContainswith the same data. Yes, I checked wheter there are any non-records in the map - there are none.Example:
When I put the Records in a List instead, it works fine with
listOf(ImmutablePropTypes.record).It's just mapOf that fails with the following message (library is the name of the property I check).
Invalid argument 'library[0]' of type 'array' supplied to 'Nav', expected 'Record'