1.0.0 • Published 2 years ago

@c2dh/react-miller v1.0.0

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
2 years ago

React Miller

Basic, powerful react hooks to get storiesand documents from our Miller API (django powered REST api). THis library is basic a wrapper for react-query(v3.39) adapted to multilanguage translation and with shortcuts for usual usage.

usage:

Wrap your App inside the Miller context and initalize a QueryClient (see react-query library)

import { Miller } from 'react-miller'
import { QueryClient } from 'react-query'
import ReactDOM from 'react-dom'
import App from './App'

ReactDOM.render(
  <Miller
    client={new QueryClient()}
    apiUrl={'/api'}
    langs={langs}
    lang={lang}
    disableTranslate={disableTranslate}
    headers={{
      'X-MILLER-TEST': 'Hello Miller :)',
    }}
  >
    <App />
  </Miller>,
  document.getElementById('root')
)

// ...
const [data] = useStories({
  params: {
    exclude: {
      tags__slug: 'static',
    },
  },
  suspense: false,
})

Development & API test

Local development allows you to set basic to test the library against different API

yarn install

PROXY=http://your-proxy LANGS=en_GB,fr_FR yarn run dev

Default env values:

PROXY=http://localhost
LANGS=en_GB,fr_FR,de_DE,it_IT
1.0.0

2 years ago

1.0.0-beta.10

2 years ago

1.0.0-beta.3

2 years ago

1.0.0-beta.4

2 years ago

1.0.0-beta.5

2 years ago

1.0.0-beta.6

2 years ago

1.0.0-beta.7

2 years ago

1.0.0-beta.8

2 years ago

1.0.0-beta.9

2 years ago

1.0.0-beta.2

2 years ago

1.0.0-beta.1

2 years ago

0.1.0

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago