UNPKG

@matt-dunn/react-wireframes

Version:

React component to annotate your components — useful for prototypes and proof of concepts

27 lines (20 loc) 579 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useApi = void 0; var _react = require("react"); var _WireframeProvider = require("./WireframeProvider"); /** ! * Copyright (c) 2019, Matt Dunn * * @author Matt Dunn */ var useApi = function useApi() { var api = (0, _react.useContext)(_WireframeProvider.WireframeAnnotationContext); if (!api) { throw new TypeError("WireframeProvider must be used to configure the api. Make sure it's defined at the top of the component tree."); } return api; }; exports.useApi = useApi;