import componentInfoContext from '../../utils/componentInfoContext'; import { ComponentInfo } from '../../types'; const useComponentProps = (componentName: string): ComponentInfo['props'] => { const info = componentInfoContext.byDisplayName[componentName]; if (!info) { throw new Error( `We don't have definitions for "${componentName}". Please ensure those are generated by "gulp-docgen" plugin`, ); } return info.props; }; export default useComponentProps;