Skip to content

Generate docs for hooks #332

@rolandjitsu

Description

@rolandjitsu

Since hooks have been released a while back, it would be nice to be able to generate docs for them.

For example, for a simple hook:

import {useState} from 'react';

/**
 * A hook to do something
 *
 * @param {object} params
 * @param {boolean} [params.disabled] Disable the thing
 * @returns {boolean}
 */
const useMyHook = (params) => {
  const [isUsing, setUsing] = useState(false);
  // Some logic here to invoke setUsing()
  return isUsing;
};

export default useMyHook;

There is not way to generate some docs. Or is there and I just can't find it?

NOTE: I am actually using react-styleguidist which uses this lib to generate component docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions