File tree Expand file tree Collapse file tree
frameworks/react/cra-17-typescript/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import React from 'react' ;
2- import logo from './logo.svg' ;
3- import { useState , useEffect } from 'react' ;
41import './App.css' ;
5- import { useGetPokemonByNameQuery } from './services/pokemon'
62
7- function App ( ) {
8- const { data : { abilities } , error, isLoading } = useGetPokemonByNameQuery ( 'bulbasaur' )
9- console . log ( { abilities } )
10- const items = [
11- { key : "overgrown" } ,
12- { key : "chlorophyll" }
13- ] ;
14- const mappedItems = items . map ( ( item ) => ( {
15- hasAbility : abilities ?. find ( ( a : any ) => a . ability . name === item . key )
16- } ) ) ;
17-
18- return (
19- < div className = "App" >
20- < header className = "App-header" >
21- < img src = { logo } className = "App-logo" alt = "logo" />
22- < p >
23- Edit < code > src/App.tsx</ code > and save to reload.
24- </ p >
25- < a
26- className = "App-link"
27- href = "https://reactjs.org"
28- target = "_blank"
29- rel = "noopener noreferrer"
30- >
31- Learn React
32- </ a >
33- { mappedItems . join ( "" ) }
34- </ header >
35- </ div >
36- ) ;
3+ function App ( ) : JSX . Element {
4+ throw new Error ( "This is an error" )
375}
386
397export default App ;
You can’t perform that action at this time.
0 commit comments