@x/serverless.react
v0.4.18
Published
React higher order components (HoCs) and hooks for accessing @x/serverless host functions
Downloads
3
Readme
@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')
)