ra-strapi-v4-rest
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Rest Strapi v4 Provider For React-Admin

Rest Strapi v4 Provider for React Admin. For Strapi v3 try ra-strapi-rest.

Installation

npm i ra-strapi-v4-rest

Usage

import * as React from "react";
import { Admin, Resource } from "react-admin";
import { strapiRestProvider } from "ra-strapi-v4-rest";

import { PostList } from "./posts";

const App = () => (
  <Admin dataProvider={strapiRestProvider("http://path.to.my.api/")}>
    <Resource name="posts" list={PostList} />
  </Admin>
);

Nested filter example

The following will return all the books written by author with id 2:

<ReferenceInput
  source="book"
  reference="books"
  filter={{
    author: {
      id: 2,
    },
  }}
>
  <SelectInput fullWidth optionText="name" />
</ReferenceInput>

License

This data provider is licensed under the MIT License.

Package Sidebar

Install

npm i ra-strapi-v4-rest

Weekly Downloads

3

Version

1.1.1

License

MIT

Unpacked Size

34.3 kB

Total Files

7

Last publish

Collaborators

  • garridorafa