# react-odata

> React component to declaratively fetch from OData v4 endpoints

Latest version **10.1.0** (published 2018-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-odata
pnpm add react-odata
yarn add react-odata
bun add react-odata
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 10.1.0 |
| Published | 2018-06-19 |
| First published | 2017-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Sean Lynch |
| Maintainers | techniq |

## Links

- npm: https://www.npmjs.com/package/react-odata
- Repository: https://github.com/techniq/react-odata
- npm.io page: https://npm.io/package/react-odata

## Recent versions

- 10.1.0 (latest) — 2018-06-19
- 11.0.0-1 (next) — 2018-12-19
- 11.0.0-0 — 2018-12-06
- 10.0.2 — 2018-05-05
- 10.0.1 — 2018-05-01
- 10.0.0 — 2018-05-01
- 9.1.0 — 2018-01-18
- 9.0.0 — 2017-11-14
- 8.0.0 — 2017-11-08
- 7.0.2 — 2017-10-21
- 7.0.1 — 2017-09-05
- 7.0.0 — 2017-09-01
- 6.0.0 — 2017-07-16
- 5.0.0 — 2017-07-07
- 5.0.0-1 — 2017-07-06
- … 35 more at https://npm.io/package/react-odata/versions

## 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' } };

<OData baseUrl={baseUrl} query={query}>
  { ({ loading, error, data }) => (
    <div>
      { loading && {/* handle loading here */} }
      { error && {/* handle error here */} }
      { data && {/* handle data here */}}
    </div>
  )}
</OData>
``` 
- See [odata-query](https://github.com/techniq/odata-query) for supported `query` syntax

### Passes remaining props to underlying `<Fetch />` component
```js
<OData baseUrl="http://services.odata.org/V4/TripPinService/People" options={{ credentials: 'include' }} />
```
- See [react-fetch-component](https://github.com/techniq/react-fetch-component) for additional props

---
_Source: https://npm.io/package/react-odata · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
