Skip to content

Conversation

@dashtinejad
Copy link
Contributor

I wrote a guide for making ajax requests in React, including:

  • Installing 3rd party library for making Ajax request (I've used jQuery for its simplicity)
  • Defining the scenario
  • Creating buttons for making Ajax requests
  • Sending Ajax requests
  • Controlling state
  • List component for showing the result
  • Aborting (cancel the request)
  • Error handling

@gaearon
Copy link
Collaborator

gaearon commented Nov 13, 2016

There is already work in #8098, have you had a chance to look at it?

@dashtinejad
Copy link
Contributor Author

@gaearon Yes, I've already seen it, and at first, I though how to improve it. But unfortunately, that documentation has some different concept from mine, which force me to create a new documentation, instead of editing the existing one, here are some:

  • I wanted to make it as simple as possible, so I don't use any lifecycle methods.
  • I wanted to use a simple (and famous) 3rd party library (for showing the way of integration)
  • I wanted to show how to abort the request (using fetch in that documentation, will make it a little complex, as there is no native abort in API)
  • I just wanted to show the techniques how to implement Ajax request in a React app, so I tried to avoid any other concepts, like ES6+ features (e.g. async/await).
  • I wanted an interactive + simple scenario, which the user can play with it.

If you have any idea, let me know.

@gaearon
Copy link
Collaborator

gaearon commented Jan 4, 2017

Thanks for the effort. I don't think we'll take a jQuery guide since jQuery isn't typically used in React apps. Most jQuery features are not very relevant in React apps so it's a disservice to users to suggest it.

I would appreciate if you could chime in here: #8098 (comment). We need a similar guide, but using axios. I think that would be the best solution and your help would be appreciated.

@gaearon gaearon closed this Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants