7.6.2. Dynamic plugin API
7.6.2.1. useActivePerspective 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Hook that provides the currently active perspective and a callback for setting the active perspective. It returns a tuple containing the current active perspective and setter callback.
Example
const Component: React.FC = (props) => {
const [activePerspective, setActivePerspective] = useActivePerspective();
return <select
value={activePerspective}
onChange={(e) => setActivePerspective(e.target.value)}
>
{
// ...perspective options
}
</select>
}