Skip to content

Commit

Permalink
chore: add comment to usePerspective
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanl17 committed Feb 12, 2025
1 parent c725f09 commit d852d90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/sanity/src/core/perspective/usePerspective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import {type PerspectiveContextValue} from './types'

/**
* @beta
*
* React hook that returns the current studio perspective and perspective stack.
*
* @returns See {@link PerspectiveContextValue}
* @example Reading the current perspective stack
* ```ts
* function MyComponent() {
* const {perspectiveStack} = usePerspective()
* // ... do something with the perspective stack ...
* }
* ```
*/
export function usePerspective(): PerspectiveContextValue {
const context = useContext(PerspectiveContext)
Expand Down

0 comments on commit d852d90

Please sign in to comment.