Start by installing the axios
package:
Note: We are intentionally installing version 0.27.2, as this won't conflict with Jest, which we will use when writing tests.
We need this to make our GET
request.
Inside your requests
folder, create a file called getImages.js
.
That file contents should look like this:
And finally, after we’ve updated our Search.js
file with our handleSubmit
it should look like this: