PropsTable does not render
See original GitHub issueBug Report
PropsTable did not render anything in the screen. (cc #138) I’m using TypeScript.
To Reproduce
---
name: Button
---
import { PropsTable } from 'docz'
import Button from './Button'
# Button
<Button onPress={() => alert('pressed')}>Click</Button>
<PropsTable of={Button} />
import React from 'react'
import { StyleSheet, Text, Touchable } from 'react-primitives'
const styles = StyleSheet.create({
text: {
color: 'green',
},
})
export interface ButtonProps {
test?: string
children: string
}
const Button: React.SFC<ButtonProps> = props => (
<Touchable {...props}>
<Text style={styles.text}>{props.children}</Text>
</Touchable>
)
export default Button
Expected behavior
Render PropsTable, getting props from TypeScript interface automatically
Environment
- OS: macOS 10.14
- Node/npm version: Node 8/npm 5
Additional context/Screenshots
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:22 (3 by maintainers)
Top Results From Across the Web
React Best Practices: Where to *not* render a component?
I've got a Hyperlink component with a url prop. If for some reason url is falsy, Hyperlink renders null . simplified example: const...
Read more >ArgsTable - Storybook - JS.ORG
This would render a row with a modified description, a type display with a dropdown that shows the detail, and no control.
Read more >react-props-table - npm
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF...
Read more >Creating and Maintaining an Organized Props Area - Theatrefolk
But the dismantled props table won't take up much space during non-show hours. 2. Remind all students that the props area is for...
Read more >Manual:Page props table - MediaWiki
Note that reparsing a page causes all of its properties to be purged from this table and replaced with the new ones, so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue. The problem was import line for ‘react’.
import * as React from 'react'
helped.@JeroenReumkens Gave it a quick try, but didn’t work with import
{ default as ComponentName } from './Component'
. Maybe this issue somehow relates to this issue atreact-docgen-typescript
?