PromptBase
Upgrade
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
Completion - GPT-3.5 (text-davinci-003)
Token size
369 ($0.00740 / call)
Example input
Programming Language to Code: Create React App, yarn, Ant Design, List, Redux Toolkit, createSlice, thunk, axios Description: Create Pokemon App that lists pokemons with images that come from PokeAPI sprites endpoint File Type: .js
Example output
import React from "react"; import ReactDOM from "react-dom"; import { BrowserRouter as Router, Route } from "react-router-dom"; import { Provider } from "react-redux"; import { configureStore } from "@reduxjs/toolkit"; import { createSlice } from "@reduxjs/toolkit"; import { thunk, axios } from "redux-thunk"; import { List } from "antd"; // Create reducer const pokemonSlice = createSlice({ name: "pokemon", initialState: { pokemons: [], loading: false }, reducers: { setPokemons: (state, action) => { state.pokemons = action.payload; }, setLoading: (state, action) => { state.loading = action.payload; } } }); const { setPokemons, setLoading } = pokemonSlice.actions; // Configure store const store = configureStore({ reducer:continue pokemonSlice.reducer }); // Fetch pokemons const fetchPokemons = () => { return async dispatch => { dispatch(setLoading(true)); const response = await axios.get("https://pokeapi.co/api/v2/pokemon?limit=151"); const pokemons = response.data.results.map(pokemon => { const spriteResponse = axios.get( `https://pokeapi.co/api/v2/pokemon/${pokemon.name}` ); pokemon.sprite = spriteResponse.data.sprites.front_default; return pokemon; }); dispatch(setPokemons(pokemons)); dispatch(setLoading(false)); }; }; // Main component const App = () => ( <Provider store={store}> <Router> <Route exact path="/" render={() => ( <List bordered dataSource={store.getState().pokemons} renderItem={pokemon => ( <List.Item> <img src={pokemon.sprite} alt={pokemon.name} width="48px" height="48px" /> {pokemon.name} </List.Item> )} /> )} /> </Router> </Provider> ); // Initialize ReactDOM.render(<App />, document.getElementById("root")); store.dispatch(fetchPokemons());
🤖 GPT

Senior Front End Developer

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
TEXT-DAVINCI-003
Tested icon
Guide icon
Free credits icon
We're grateful that you're thinking about buying this prompt. How often do you think, "I really want to learn how to code"? Using this nudge, you may hire a skilled programmer to work on your project. As a whole, he'll be responsible for coding. When you click this button, you'll be connected with a skilled code developer who can transform your project from a concept into a working app.
...more
Added over 1 month ago
Report
  • Reviews for this prompt (1)
Browse Marketplace