Making Ajax Calls in React – Part 2

If you haven’t already, take a look at Part 1 of this tutorial. It goes through the basics of setting up a React app and making GET requests to the dog.ceo API to pull pictures of random doggos! In this part of the tutorial we’ll make POST requests to save which pictures are our favorites! The Dog API doesn’t actually have this ability so I’ve built out a small API that you can use to practice on. Step 1. Updating our initial state Since our app now saves favorites, we need to update our state object to include this. So

Continue reading

How to make Ajax calls in a React App

Want to start working with API’s and making ajax calls in your react apps? This tutorial will help get you started with using the Fetch API to do just that. It’s expected that you’ve done a few React tutorials before going through this one, but if you haven’t thats okay! I will explain everything as I go. But you should at least have create-react-app installed before starting. What will we be making? We will be using the Dog API from dog.ceo to pull random dog images to display on a web page. Simple, but hopefully it will get you comfortable

Continue reading