question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addon-docs: Proposal to link interfaces

See original GitHub issue

In typescript projects, some (legacy) components accept large interfaces into a single prop name. In this case the prop table is really not very helpful as it shows only the top level property. I understand this is not a top priority, but just to keep it on file, can we have an option to ‘link’ embedded properties.

example of a prop table https://atanasster.github.io/grommet-controls/?path=/docs/charts-chartjs-barchart--main

it has only two props:

options: IChartjsOptions;
data:IChartjsData;

It would be more helpful to be able to link or expand the IChartjsOptions interface to actually see the available properties.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:20
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
adhiravishankarcommented, Apr 12, 2020

Is there a way to do this within the MDX formatting? Even if there isn’t a way to do this with CSF format and for nested interfaces, I think that having an MDX way to add this would be ideal because it would allow us to include it manually as well. In my use case, I don’t need it with the parent. I need mine separately that I can link to via CSF or MDX (either one is fine), but I do want it separate to make it simpler.

3reactions
SimeonRolevcommented, Aug 19, 2021

This would be very useful. With something like this, I only get the name of the interfaces in the Controls/Docs panels. Reusing types/interfaces in multiple places is a pretty common use case. Has anyone came up with a workaround?

interface First = {
    first_one: boolean,
    first_two: string
}

interface Second =  {
    second_1: number,
    second_2: () => void
}

interface Props = {
    first: First,  // <---
    second: Second,  // <---
    regular: boolean
}

export const Component: FunctionComponent<Props> = ({ first, second, regular }: Props): React.ReactElement => { ... }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Storybook addon-docs in Typescript strange behaviour
I want to use storybook addon-docs with my typescript react project. I almost have it working but the file name seems to be...
Read more >
gatsby-interface | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
T54097 Proposal: Addon documentation for 2.8
Addon docs are removed from source. One of the current issues is that the source files for add-ons and the documents are handled...
Read more >
gatsby-interface - npm
Component library for Gatsby projects. Latest version: 0.0.294, last published: 4 days ago. Start using gatsby-interface in your project by ...
Read more >
Migrating from Styleguidist to Storybook - Yelp Engineering Blog
... we were able to offer a faster and more user-friendly development ... that developers use to develop and view their user interfaces....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found