Skip to content

Commit

Permalink
fix: display React props name instead values
Browse files Browse the repository at this point in the history
  • Loading branch information
mleralec committed Jan 10, 2022
1 parent 3c951d8 commit 89c61eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/components/Props.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ const removeQuote = str => str?.toString()?.replace(/'/g, '')

const isArray = Array.isArray

const reactTypes = ['ElementType<any>']

function Type({ type }) {
if (!type) {
return null
}
const { name, raw, value } = type

if (reactTypes.includes(raw)) {
return `React.${raw}`
}

if (raw === 'boolean') return 'Boolean'

// Enum
Expand Down

0 comments on commit 89c61eb

Please sign in to comment.