I used the code example from the official RTK query documentation
CodePudding user response:
Entity adapter default expects the entity to have id
for unique identification. In your case, as i can see, unique id of the user id named as _id
.
Try the following way of explicitly setting the id:
const usersAdapter = createEntityAdapter({
selectId: (user) => user._id,
});
Hopefully, that should fix the issue.
Thanks.