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.

](https://img.codepudding.com/202211/6925053d29d1468bbe426555d37f041b.png)
](https://img.codepudding.com/202211/096d459949bd42c3806fc55dc22763fe.png)