Skip to content

Commit

Permalink
Update React integration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyyakym committed Dec 17, 2023
1 parent ab69619 commit 59c5021
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/docs/Integrations/React.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ npm i awai-react

This library provides hooks for connecting Awai's state nodes with React components.

* `useSetState` - returns a `state.set` method (can be used directly).
- **useSetState** - returns a `state.set` method (can be used directly).

* `useStateValue` - returns curent state value. It works with suspense and ensures that async node is loaded.
- **useStateValue** - returns curent state value. It works with suspense and ensures that async node is loaded.

* `useState` - Returns a tuple `[useStateValue(state), useSetState(state)]`, just to be aligned with React's `useState` interface.
- **useState** - Returns a tuple `[useStateValue(state), useSetState(state)]`, just to be aligned with React's `useState` interface.

* `useAsyncStateValue` - this hook only works with `ReadableAsyncState` (eg. [AsyncState](/async-state)) and returns a result of `getAsync` method. Unlike `useStateValue` this hook does not suspend. That means that component is rendered even though state is not yet initialized, which results in `value` to be possibly `undefined`.
- **useAsyncStateValue** - this hook only works with `ReadableAsyncState` (eg. [AsyncState](/async-state)) and returns a result of `getAsync` method. Unlike `useStateValue` this hook does not suspend. That means that component is rendered even though state is not yet initialized, which results in `value` to be possibly `undefined`.

0 comments on commit 59c5021

Please sign in to comment.