Skip to main content

Quick Start

Let's begin by importing useStateValue from 'cotton-box-react'.

import { useStateValue } from 'cotton-box-react'

Then, we can pass our State Manager to the hook.

const state = useStateValue(ExampleState)

The example below shows how we can read from CounterState from inside a React component.