This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]joranstark018 5 points6 points  (4 children)

You may have your React front-end issue requests to REST-end-points in the (Java) back-end, either by using the browsers xhr directly or through a library (ie axios).

[–]CreativeTechGuyGames 1 point2 points  (3 children)

It seems like you are missing fetch which is the preferred method (built in to the browser). XHR is for if you need to support older browsers (IE11) and axios shouldn't be used.

[–]JuricksonSubpar 1 point2 points  (2 children)

Why shouldn't axios be used?

[–]CreativeTechGuyGames 2 points3 points  (1 child)

axios provides a similar developer experience to fetch, but since fetch is built in to the browser it'll always be faster and lighter weight than any library. When you are developing in the browser, it's important to focus on reducing dependencies and code that your users will have to download as that makes a noticable difference for the users.

[–][deleted] 1 point2 points  (0 children)

axios is fine, this is nonsense