Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Shape of Array not been displayed with Flow #167

Closed
Swapnull opened this issue Jul 25, 2018 · 2 comments
Closed

Shape of Array not been displayed with Flow #167

Swapnull opened this issue Jul 25, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@Swapnull
Copy link
Contributor

Bug Report

Similar to #153 but with flow.

When using flow and defining the Prop Types as an array with a type, docz only outputs that it is an array.
eg.

type Props = {
  /** Array of objects with the shape of label: string, content: any */
  tabs: Array<{ label: string, content: any }>
};

Produces
screen shot 2018-07-25 at 12 10 09

Expected behavior

running react-docgen produces

{"description":"","displayName":"Tabs","methods":[],"props":{"tabs":{"flowType":
{"name":"Array","elements":[{"name":"signature","type":"object","raw":"{ label: string, content: any
 }","signature":{"properties":[{"key":"label","value":{"name":"string","required":true}},
{"key":"content","value":{"name":"any","required":true}}]}}],"raw":"Array<{ label: string,content: any 
}>"},"required":true,"description":"Array of objects with the shape of label: string, content: any"}}}

If possible, grab the signature from there.

Enviroment

  • OS: OSX 10.13.4
  • Node/npm version: Node 8/npm 5
  • Docz version: 0.7.1
@pedronauck
Copy link
Member

Great, I did see this working with shape with prop-types, but not with flow. I'll try to release some patch fixing that, thanks @Swapnull 🙏

@pedronauck pedronauck added the bug Something isn't working label Jul 25, 2018
@pedronauck
Copy link
Member

pedronauck commented Jul 28, 2018

Fixed on v0.8.0

pedronauck added a commit that referenced this issue Aug 2, 2018
…r-refac

* 'dev' of github.com:pedronauck/docz:
  feat(docz-theme-default): add edit button for document (#180)
  fix(docz-theme-default): not found typo (#173)
  feat(docz-core): support env files to set configuration (#171)
  chore(docz): add entry prop on document wrapper
  feat(docz-core): add webpack-serve-overlay as error overlay
  feat(docz-plugin-svgr): add initial version of plugin
  fix(docz-core): remove babel plugin/presets when needed
  chore(docz): use react-loadable instead of loadable-components
  chore(docz-theme-default): some Handle adjustments
  chore: update dependencies
  fix(docz-theme-default): hot reload on fullscreen mode
  v0.8.0
  chore(docz-theme-default): some colors adjustments
  feat(docz-theme-default): add html output on playground
  chore(docz): remove __rawCode from playground
  chore(docz-theme-default): change text color of light mode
  fix(docz-theme-default): get fullscreen from localstorage
  fix(docz): humanize array type of flow (fix #167)
  fix: change link on readme (#168)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants