- Build a component with an effect hook that watches for changes to a given value and triggers the effect
- Fork this repository
- Clone the forked repository onto your local machines
- In the root directory, type
npm ci
, which installs dependencies for the project - Finally, type
npm run dev
, which starts a development server that runs your website in the browser.
- In
App.jsx
set up auseEffect
to run whenever thedataType
state is changed - When the effect is triggered, make a
fetch
request tohttps://swapi.dev/api/${dataType}/
- NOTE: you must include the ending
/
in your API URL - The string values which
dataType
can have are:people
,planets
andstarships
- NOTE: you must include the ending
- Store the returned JSON data in the
data
state usingsetData