could someone lend me a hand at this?
I have a code that is working fine, it shows a list of all fire type Pokemon, the names and the images. It is showing all fire pokemon (100 pokemon more or less), but i want to request ONLY the first 10, the is a way to do this? (i have tried to put "params: _limit:10" at the axios.get function but didnt work.
export default class PokemonList extends Component {
state= {
url: 'https://pokeapi.co/api/v2/type/fire',
pokedata: null
};
async componentDidMount() {
const res = await axios.get(this.state.url);
this.setState({ pokedata: res.data['pokemon'] })
}
render() {
return (
<PanelArea>
{this.state.pokedata ? (
<div className='row'>
{this.state.pokedata.map(pokedata =>
<PokemonCard
key={pokedata.pokemon.name}
name={pokedata.pokemon.name}
url={pokedata.pokemon.url}
/>
)}
</div>
) : (
<h1> Carregando Pokemon </h1>
)}
</PanelArea>
)};
}