mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-24 05:54:18 +00:00
14 lines
No EOL
407 B
JavaScript
14 lines
No EOL
407 B
JavaScript
import { useContext } from "react"
|
|
import ContextRepositoryEditor from "../contexts/ContextConditionEditor"
|
|
|
|
|
|
/**
|
|
* Hook to quickly use {@link ContextRepositoryEditor}.
|
|
*/
|
|
export default function useRepositoryEditor() {
|
|
const context = useContext(ContextRepositoryEditor)
|
|
if(!context) {
|
|
throw new Error("This component must be placed inside a RepositoryEditor.")
|
|
}
|
|
return context
|
|
} |