Beta
React hook that returns the current studio perspective and perspective stack.
This will use the closest PerspectiveContext provider, which is either the global PerspectiveContext or the DocumentPerspectiveProvider.
See PerspectiveContextValue
function MyComponent() { const {perspectiveStack} = usePerspective() // ... do something with the perspective stack , like passing it to the client perspective.} Copy
function MyComponent() { const {perspectiveStack} = usePerspective() // ... do something with the perspective stack , like passing it to the client perspective.}
React hook that returns the current studio perspective and perspective stack.
This will use the closest PerspectiveContext provider, which is either the global PerspectiveContext or the DocumentPerspectiveProvider.