Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaltarasiuk committed Jan 28, 2023
1 parent d70c5ee commit f833f4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/useStateRef/__docs__/story.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ export function useStateRef<Node extends HTMLElement | null, StateRef>(
#### Arguments

- **refCallback** _`(node: HTMLElement) => unknown`_ - Function which call on mount and unmount of component.

#### Return

- _**[0]**_ _`unknown`_ - return value of `refCallback`
- _**[1]**_ _`(node: HTMLElement) => void`_ - handler which update `stateRef`
3 changes: 2 additions & 1 deletion src/useStateRef/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { useSyncedRef } from '../useSyncedRef';
/**
* Hook with callback which provide access to DOM node reference.
*
* @param refCallback Function which call on mount and unmount of component.
* @param refCallback Function which call on mount and unmount of component
* @returns return value of `refCallback` and handler
*/
export const useStateRef = <Node extends HTMLElement | null, StateRef>(
refCallback: (node: Node) => StateRef
Expand Down

0 comments on commit f833f4a

Please sign in to comment.