B
B
bogac2018-12-16 01:21:58
React
bogac, 2018-12-16 01:21:58

Passing data AJAX REACT?

Good evening!

After jquery, I started learning React.
With jquery, it was easy enough to write an ajax request that submits the data from the form:

$.ajax({
            url: *.php,
            method: "post",
            data: data,
            error:function (message) {
                console.log('err');
            },
            success:function (data) {
                console.log('ok');
}
 }),


How to do the same in react?
I am getting data from Store.getValue() form.
How to make a correct ajax request?
I would be grateful for literature, where you can read about it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dev null, 2018-12-16
@bogac

How to make an Ajax request with React js?

A
Anton Filippov, 2018-12-16
@vicodin

https://github.com/axios/axios/blob/master/README.md Here's the literature for you
TL;DR On the modern web, this is done much more elegantly than in jQuery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question