How to use the docz.doczState.context function in docz

To help you get started, we’ve selected a few docz examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gribnoysup / react-yandex-maps / docz / components / Props.js View on Github external
export const Props = ({ title, isToggle, isRaw, of: component }) => {
  const components = useComponents();
  const { props: stateProps } = React.useContext(doczState.context);
  const PropsComponent = components.props;
  const filename = get('__filemeta.filename', component);
  const filemetaName = get('__filemeta.name', component);
  const componentName = filemetaName || component.displayName || component.name;
  const found =
    stateProps &&
    stateProps.length > 0 &&
    stateProps.find(item =>
      filename ? item.key === filename : item.key.includes(`${componentName}.`)
    );

  const value = get('value', found) || [];
  const firstDefinition = first(value);
  const definition = value.find(i => i.displayName === componentName);

  const compileMarkdown = React.useMemo(

docz

It's has never been so easy to documents your things!

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis