react-use-value
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

React useValue

NPM badge Dependabot badge Dependencies Build Status Coverage Status

Solves the problem of updating an internal component based on values passed in from a different source that can be updated independently.

Usage

You have an initial text value of "John Doe" loaded and kept in sync with the source of the value e.g. web API, and need the field holding that value updated to "Jane Doe" without affecting the parent but also be reset to the parent value when it's changed to a newer version like "John M. Doe".

Example code

import { useValue, useTrackedValue, useSyncedValue } from 'react-use-value';

See type documentation for details on how each is used.

Demo

synced input values

Edit on StackBlitz ⚡️

Readme

Keywords

none

Package Sidebar

Install

npm i react-use-value

Weekly Downloads

0

Version

1.0.0

License

none

Unpacked Size

15.4 kB

Total Files

6

Last publish

Collaborators

  • iamogbz