Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document static sub-components #265

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

hipstersmoothie
Copy link
Contributor

@hipstersmoothie hipstersmoothie commented Jun 16, 2020

Adds the ability to generate docs for static sub-components. Works in both function and class components

import * as React from "react";

interface LabelProps {
  /** title description */
  title: string;
}

/** StatelessStaticComponents.Label description */
const SubComponent = (props: LabelProps) => <div>My Property = {props.title}</div>;

interface StatelessStaticComponentsProps {
  /** myProp description */
  myProp: string;
}

/** StatelessStaticComponents description */
export const StatelessStaticComponents = (props: StatelessStaticComponentsProps) => (
  <div>My Property = {props.myProp}</div>
);

StatelessStaticComponents.Label = SubComponent;

The code will construct a displayName from the parent component + the sub component's name.

closes #98

@hipstersmoothie
Copy link
Contributor Author

@pvasek could you release this PR? thanks!

@pvasek
Copy link
Collaborator

pvasek commented Jun 19, 2020

@hipstersmoothie it has been released as v1.8.0.

@hipstersmoothie
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to document class inner static components
2 participants