@obl/react-http-req
v1.0.0
Published
React base components for doing HTTP requests
Downloads
2
Readme
react-http-req
Install
npm install @obl/react-http-req
Usage
import React from 'react';
import Requester from "@obl/react-http-req";
/*
Simple application for fetching data
from REST API server
*/
const App = () => (
<div>
<Requester baseUrl="http://jsonplaceholder.typicode.com/posts" params={{userId: 1}}>
{
(data) => (
<div>
{JSON.stringify(data.response, null, 4)}
</div>
)
}
</Requester>
</div>
);
export default App;