Skip to content

Commit 255a8f3

Browse files
committed
Fix React 17 app
Have it throw an error so the tests fail.
1 parent 9c96741 commit 255a8f3

1 file changed

Lines changed: 2 additions & 34 deletions

File tree

  • frameworks/react/cra-17-typescript/src
Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,7 @@
1-
import React from 'react';
2-
import logo from './logo.svg';
3-
import { useState, useEffect } from 'react';
41
import './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

397
export default App;

0 commit comments

Comments
 (0)