1

I'm learning ReasonReact and I would like to fetch data from a API, that I'm going to use on my component. However, on the official website about Reason or ReasonReact there's nothing about this, neither I found something searching on Google. How can I do it?

Mateus Felipe
  • 1,071
  • 2
  • 19
  • 43

1 Answers1

1

You can use the existing bindings to HTTP client libraries, e.g.:

The former works in browser only, the latter works in both browser and Node.

In general, if you're looking for a way to do something, Redex is a great place to look.

Yawar
  • 11,272
  • 4
  • 48
  • 80
  • 1
    Well, didn't know about Redex! Thanks for this! About bs-fetch, I did see it when searching on Google, I just though there could be a "native" way of doing this. Seems that bs-fetch is the way for me! – Mateus Felipe Mar 27 '18 at 19:56
  • 3
    `bs-fetch` works in node too, just not out-of-the-box. It requires a polyfill: – glennsl Mar 28 '18 at 05:52