r/reactjs • • Aug 01 '18

Beginner's Thread / Easy Question (August 2018)

Hello! It's August! Time for a new Beginner's thread! (July and June here)

Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple. You are guaranteed a response here!

Want Help on Code?

  • Improve your chances by putting a minimal example on to either JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new). Describe what you want it to do, and things you've tried. Don't just post big blocks of code.
  • Pay it forward! Answer questions even if there is already an answer - multiple perspectives can be very helpful to beginners. Also there's no quicker way to learn than being wrong on the Internet.

New to React?

Here are great, free resources!

27 Upvotes

568 comments sorted by

View all comments

Show parent comment

1

u/dceddia Aug 20 '18

Very strange. You mention you use the same superagent code though, and in one snippet I see you're using axios, and in DELETE one, axios is commented out. Is it maybe a difference with those 2 libraries?

1

u/dndminiprinting Aug 20 '18

Yeah the difference with the 2 libraries was how they made the delete request, and I usually use axios but when I made the backend, I made it in a certain way that I needed superagent instead.

Was easier to use superagent than to go redo the backend code.

But I found a solution to the issue, and it was an embarrassing one. I was just using the wrong ID variable in the delete request lol. I had the api ID and the database ID, and I confused the two in my head. Everything is working fine now.