React 18 for Beginners - Bug with the Platforms filter

After building the games app and checking a few things out I had noticed that the Platforms dropdown wasn’t doing what it was supposed to do.

When I click on a platform, say, XBOX- I don’t even see the XBOXicon in the PlatformList (other platforms appear, but not XBOX).

This is because of the response we get back from the rawg.io API:

{
“id”: 3,
“name”: “Xbox”,
“slug”: “xbox”,
“platforms”: [
{
“id”: 1,
“name”: “Xbox One”,
“slug”: “xbox-one”
},
{
“id”: 186,
“name”: “Xbox Series S/X”,
“slug”: “xbox-series-x”
},
{
“id”: 14,
“name”: “Xbox 360”,
“slug”: “xbox360”,
},
{
“id”: 80,
“name”: “Xbox”,
“slug”: “xbox-old”
}
]
}

In this scenario, we build the platforms selector using the parent id - which is 3. Then we search for games with a Platform Id of 3 - but REALLY, we should be searching for Games with a Platform Id of 1, 186, 14 or 80 - but I believe in this case, Id = 3 corresponds to iOS games

Example of this:

Anyway, I hope this helps - not an issue with the content Mosh has provided (awesome btw) - but just something I had noticed.

I also noticed this issue. Is there anything we can do to fix it?

It is most likely because you are grabbing the all platforms instead of the “parent_platforms” set your game interface for the platforms to be parent_platforms: {platform: Platform}