An open API service indexing awesome lists of open source software.

https://github.com/techniq/react-odata

React component to declaratively fetch from OData v4 endpoints
https://github.com/techniq/react-odata

odata react

Last synced: 10 months ago
JSON representation

React component to declaratively fetch from OData v4 endpoints

Awesome Lists containing this project

README

          

# react-odata

React component to declaratively fetch from OData v4 endpoints

## Install
```
yarn add react-odata
```
or
```
npm install --save react-odata
```

## Usage
### Import
```js
import OData from 'react-odata';
```

### Basic
```js
const baseUrl = 'http://services.odata.org/V4/TripPinService/People';
const query = { filter: { FirstName: 'Russell' } };

{ ({ loading, error, data }) => (


{ loading && {/* handle loading here */} }
{ error && {/* handle error here */} }
{ data && {/* handle data here */}}

)}

```
- See [odata-query](https://github.com/techniq/odata-query) for supported `query` syntax

### Passes remaining props to underlying `` component
```js

```
- See [react-fetch-component](https://github.com/techniq/react-fetch-component) for additional props