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.

Imported interfaces not displaying in Prop tables

See original GitHub issue

When extending an interface with another imported from another file, the prop table doesn’t render any of the imported properties. I assume this would also apply when using the Type’s too.

eg:


// Foo.tsx

export interface Foo {
  bar?: string
}

// Component.tsx

import { Foo } from './Foo.tsx'

interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement>, Foo {
  disabled?: boolean
}

const Component = ( { disabled = false, children }: Props) => <button disabled={disabled}>{children}</button>

☝🏼Prop table only outputs the disabled prop (ignores bar)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tobiaskrauscommented, Mar 30, 2020

I have the same issue, and #9556 is not the same as the issue described here.

@sami616 wrote

Prop table only outputs the disabled prop (ignores bar)

So it did render the base properties, and not like in 9556 described, nothing. I am NOT using the default import syntax React.FunctionComponent but the named export syntax FunctionComponent and I try to extend another properties interface from another file (named export), and it ignores these properies:

// InptTextField.tsx
export interface InputTextFieldProps {
  placeholder?: string;
  labelId?: string;
  error?: boolean;
}


// Input.tsx
import InputTextField, { InputTextFieldProps } from './elements/InputTextField';

export interface InputProps extends InputTextFieldProps {
  forTag?: string;
  labelText?: string;
}

const Input: FunctionComponent<InputProps> = ({

Output in Storybook:

Name Description Default
forTag string -
labelText string -

So my properties from other file are ignored.

1reaction
kylemhcommented, Jan 20, 2020

It’s not about any imported type, but rather it’s about using types stemming from an import of a default export.

https://github.com/storybookjs/storybook/issues/9556

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find my typescript property under the interface folder ...
ts) in the book.component.ts. then it's working fine.but I want to keep this interface(book.ts) outside my component.ts file. how i ...
Read more >
Use Interface Props in Functional Components ... - Pluralsight
This guide will cover how to strongly type the props in a function component with the TypeScript interface. Use Case. Consider a situation...
Read more >
Entering Interface Table Load IDs for Import Profiles
When importing dimensions and members from interface tables, all dimensions and members are automatically imported. However, there is a i_Load_ID column in ...
Read more >
Import and Export Architecture Models - MATLAB & Simulink
You can extend these tables and add information like applied stereotypes, property values, linked model references, variant components, interfaces, ...
Read more >
Real Magic: Building Custom Interface Tables with Cameo ...
However, these built-in tables are often not flexible enough or do ... derived property Updated table with the two new columns showing the ......
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