Skip to content

Commit

Permalink
Docs: broken links to react bindings API and (#80)
Browse files Browse the repository at this point in the history
* [docs] Missing deps array for useComputed

* [docs] broken links to react bindings API

* use pnpm to run auto

* just pnpm auto

* remove --

---------

Co-authored-by: David Sheldrick <[email protected]>
  • Loading branch information
c01nd01r and ds300 authored Jan 3, 2024
1 parent 0c618e3 commit dbd0a85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: 8BitJonny/[email protected]
id: PR

- run: yarn auto pr-check --pr $PR --url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- run: pnpm auto pr-check --pr $PR --url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
PR: ${{ steps.PR.outputs.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions docs/docs/react-bindings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ We provide officially-supported React bindings for `signia` in two packages:

- `signia-react` provides hooks for creating and consuming signals in functional components.
- [`useAtom`](API/signia_react/functions/useAtom) - A hook for creating atomic signals.
- [`useComputed`](API/signia_react/functions/useAtom) - A hook for creating computed signals.
- [`track`](API/signia_react/functions/useAtom) - component wrapper for automatically tracking signal value access and re-rendering the wrapped component if the signals' values change.
- [`useValue`](API/signia_react/functions/useAtom) - A hook for manually tracking signal value access (not required if you use `track`)
- [`useComputed`](API/signia_react/functions/useComputed) - A hook for creating computed signals.
- [`track`](API/signia_react/functions/track) - component wrapper for automatically tracking signal value access and re-rendering the wrapped component if the signals' values change.
- [`useValue`](API/signia_react/functions/useValue) - A hook for manually tracking signal value access (not required if you use `track`)
- `signia-react-jsx` provides a minimal global jsx integration for use with TypeScript's `jsxImportSource` option. This causes all functional components to be automatically
tracked. It does not provide any automatic unpacking (i.e. dereferencing) of signal values.

Expand Down
5 changes: 4 additions & 1 deletion packages/signia-react/src/useComputed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import { Computed, computed, ComputedOptions } from 'signia'
* }
*
* const Greeter = track(function Greeter ({firstName, lastName}: GreeterProps) {
* const fullName = useComputed('fullName', () => `${firstName.value} ${lastName.value}`)
* const fullName = useComputed('fullName', () => `${firstName.value} ${lastName.value}`, [
* firstName,
* lastName,
* ])
* return <div>Hello {fullName.value}!</div>
* })
* ```
Expand Down

1 comment on commit dbd0a85

@vercel
Copy link

@vercel vercel bot commented on dbd0a85 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

signia – ./

signia-tldraw.vercel.app
signia.vercel.app
signia-git-main-tldraw.vercel.app
signia.tldraw.dev

Please sign in to comment.