Android Update Internet Latest news Technology Reviews

redux: Pass Query Arguments to RTK Query Hooks

Instructor: [0:00] We still have the problem that no matter where we click, we always get the Bulbasaur and point back. To change that, we have to pass in either the number of the Pokémon or the name of the Pokémon here in our URL. Let’s make it variable.
[0:17] Let’s say we want to pass in a name here and now, we have to bring that name in here in some way. Let’s pass it in as an argument. Now that this is set up, we can just pass it into the hook. We take this Pokémon name here and pass it as the argument named name into our hook.

[0:43] Looking back at the browser, if we cut GO Charmander now, we get that. It works.