storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.68k stars 9.32k forks source link

Doc Plugin doesnt pick up jsdoc Information #13530

Open clarknova opened 3 years ago

clarknova commented 3 years ago

Describe the bug The Stroybook docs plugin does not pick up my jsdoc description of my react components. No knobs are created and the component description contains the raw jsdoc information

To Reproduce Create any functional component and describe the params with jsdoc

Expected behavior The docs page contains the proper parameter descriptions based on my jsdoc definition

Screenshots Screenshot 2020-12-28 141500

Code snippets

import React from "react";
const sizes = { small: "max-w-sm", large: "max-w-2xl", full: "w-full" };

/**
 * Box Layout Component
 *
 * @param {Object} props
 * @param {Boolean=} props.scrollable
 * @param {Boolean=} props.padded
 * @param {(JSX.Element | String)=} props.children
 * @param {function():any=} props.onClick
 * @param {('small'|'large'|'full')=} props.size
 * @param {String=} props.className
 */
export default function Container({
  children,
  padded,
  scrollable,
  className,
  size,
  ...props
}) {
  return (
    <div
      className={`flex flex-col flex-auto ${
        scrollable ? "overflow-auto" : "overflow-hidden"
      } ${padded && "p-4"} ${sizes[size]} ${className}`}
      {...props}
    >
      {children}
    </div>
  );
}

System System: OS: Linux 4.19 Ubuntu 20.04.1 LTS (Focal Fossa) CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz Binaries: Node: 15.0.1 - ~/.nvm/versions/node/v15.0.1/bin/node npm: 7.0.3 - ~/.nvm/versions/node/v15.0.1/bin/npm npmPackages: @storybook/addon-actions: ^6.1.11 => 6.1.11 @storybook/addon-essentials: ^6.1.11 => 6.1.11 @storybook/addon-links: ^6.1.11 => 6.1.11 @storybook/node-logger: ^6.1.11 => 6.1.11 @storybook/preset-create-react-app: ^3.1.5 => 3.1.5 @storybook/react: ^6.1.11 => 6.1.11

jsg2021 commented 3 years ago

I would love for this to work as well.

AndyOGo commented 3 years ago

JSDoc/TSDoc doclets would be great in addition to to react-docgen comments.