Skip to content

seasonedcc/croods

Folders and files

NameName
Last commit message
Last commit date
Oct 11, 2021
Nov 29, 2021
Aug 11, 2021
Jul 19, 2021
Jun 21, 2019
Aug 7, 2019
May 24, 2021
Apr 5, 2021
Jun 25, 2021
May 14, 2021
Apr 11, 2019
Jul 18, 2019
Jul 19, 2021
Jul 19, 2021
Jul 18, 2019
Jun 25, 2021
Aug 11, 2021

Repository files navigation

Croods

Croods is a library that abstracts the REST data layer of your back-end providing you a simple API to integrate it with react applications. A simple "Hello world" would look like this:

Install

yarn add croods react react-dom lodash axios

Usage

// src/App.js

import React from 'react'
import { Fetch } from 'croods'

export default props => (
  <Fetch
    baseUrl="https://dog.ceo/api/breed/beagle"
    name="images"
    parseResponse={response => response.data.message}
    render={list => (
      <div>
        <h1>Hello Beagles!</h1>
        <ul>
          {list.map((item, index) => (
            <li key={index}>
              <img src={item} alt={Beagle  ${index)`}/>
            </li>
          ))}
        </ul>
      </div>
    )}
  />
)

Check out the docs to understand more about it!