reactjs / reactjs/react.dev

Adding description to types

Open
#6,564 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Can we add types description for React types, that can be supported for docs generators?

For example we use next inheritance:

import React, { ButtonHTMLAttributes, FC } from 'react'

export interface ActionIconProps
  extends Pick<
      ButtonHTMLAttributes<HTMLButtonElement>,
      | 'title'
      | 'tabIndex'
      | 'className'
      | 'style'
      | 'aria-label'
      | 'aria-haspopup'
      | 'aria-expanded'
      | 'onClick'
      | 'onKeyDown'
      | 'onMouseDown'
      | 'onFocus'
      | 'onBlur'
      | 'disabled'
    > {
  /** My custom property */
  myProp: string
}

and in doc system like Storybook it generated without description.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the ActionIconProps example from the issue in the documentation generator or Storybook setup. Trace how inherited React types and the /** My custom property */ description are processed; done means generated documentation preserves descriptions for these inherited and custom properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, storybook, typescript
Domain
documentation, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.