Socket
Socket
Sign inDemoInstall

@c2dh/react-miller

Package Overview
Dependencies
32
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @c2dh/react-miller

React hooks for Miller django app


Version published
Weekly downloads
3
increased by200%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 04 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc