open-index/open-npm huggingface dataset:
npm package: @stateloom/react
Description: React 18+ adapter for StateLoom -- hooks bridging reactive signals, stores, atoms, and proxies to React components via `useSyncExternalStore`.
Latest version: 1.0.0-alpha.0

# @stateloom/react

React 18+ adapter for StateLoom -- hooks bridging reactive signals, stores, atoms, and proxies to React components via `useSyncExternalStore`.

## Install

```bash
pnpm add @stateloom/react @stateloom/core
```

## Quick Start

```tsx
import { signal, computed } from '@stateloom/core';
import { useSignal } from '@stateloom/react';

const count = signal(0);
const doubled = computed(() => count.get() * 2);

function Counter() {
  const value = useSignal(count);
  const double = useSignal(doubled);
  return (
    <button onClick={() => count.set(value + 1)}>
      {value} x2 = {double}
    </button>
  );
}
```

## API

| Import Path              | Exports                                                         | Purpose                          |
| ------------------------ | --------------------------------------------------------------- | -------------------------------- |
| `@stateloom/react`       | `useSignal`, `ScopeProvider`, `useScopeContext`, `ScopeContext` | Core signal bridging + SSR scope |
| `@stateloom/react/store` | `useStore`                                                      | Store integration with selectors |
| `@stateloom/react/atom`  | `useAtom`, `useAtomValue`, `useSetAtom`                         | Atom hooks                       |
| `@stateloom/react/proxy` | `useSnapshot`                                                   | Proxy snapshot integration       |

## Requirements

- React 18+ (for `useSyncExternalStore`)
- `@stateloom/core` (required peer dependency)
- `@stateloom/store`, `@stateloom/atom`, `@stateloom/proxy` (optional peer dependencies)

## Documentation

Full documentation with examples, API reference, patterns, and migration guides: [docs/api/react](../../docs/api/react/)

## License

MIT