0.4.18 • Published 4 years ago

@x/serverless.react v0.4.18

Weekly downloads
-
License
UNLICENSED
Repository
gitlab
Last release
4 years ago

@x/serverless.react

React higher order components (HoCs) and hooks for accessing @x/serverless host functions

Installation

yarn add @x/serverless.react

Usage

All HoCs and hooks, with the exception of the useObservable hook, require a Provider component to be created higher in the component tree.

A minimal configuration using locally stored data might look like:

import React from 'react'
import ReactDOM from 'react-dom'
import host from '@x/serverless.host'
import { Provider } from '@x/serverless.react'
import App from './App'

ReactDOM.render(
  <Provider host={host()}>
    <App />
  </Provider>,
  document.getElementById('root')
)

Documentation

Documentation is available for the HoCs and hooks.