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.

react-docgen issues related to flow upgrade

See original GitHub issue

A couple of issues found with recent flow changes, documented by @oliviertassinari and consolidated here.

I’ll be working these issues into PR #9203


From: https://github.com/callemall/material-ui/pull/9212#issuecomment-345435325

@rosskevin Some broken things I have noticed introduced with #8983. I don’t think that we should put flow interest on top of API ones. Way more people read the API documentation than uses flow.

  • We mark properties required while they are not.
-| component | ElementType | 'div' | The component used for the root node. Either a string to use a DOM element or a component. |
+| <span style="color: #31a148">component *</span> | ElementType | 'div' | The component used for the root node. Either a string to use a DOM element or a component. |
  • The classes property is missing in some components.
-| classes | Object |  | Useful to extend the style applied to components. |
+| classes | Object |  |  |
  • A theme property has been added to all the components.
+| theme | Object |  |  |

From: https://github.com/callemall/material-ui/pull/9203#issuecomment-345377494

A sample of the API diff it’s introducing:

 | Name | Type | Default | Description |
 |:-----|:-----|:--------|:------------|
 | classes | Object |  | Useful to extend the style applied to components. |
-| <span style="color: #31a148">component *</span> | ElementType | 'div' | The component used for the root node. Either a string to use a DOM element or a component. |
+| <span style="color: #31a148">component *</span> | ElementType | 'div': ElementType | The component used for the root node. Either a string to use a DOM element or a component. |

I’m wondering if we can avoid 'div': ElementType. Any idea?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
rosskevincommented, Nov 18, 2017

I just submitted react-docgen PR https://github.com/reactjs/react-docgen/pull/231

It solves required/optional and flow type casts.

1reaction
rosskevincommented, Nov 18, 2017

@rsolomon if you can PR the change to react-flow-types that would be most helpful. I’ve almost got all the docs changes here wrapped up. Still one bug on my docgen PR for a good pass on material-ui codebase.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-docgen issues related to flow upgrade #9222 - GitHub
A couple of issues found with recent flow changes, documented by @oliviertassinari and consolidated here. I'll be working these issues into ...
Read more >
react-docgen - npm
A CLI and toolkit to extract information from React components for documentation generation.. Latest version: 5.4.3, last published: 6 ...
Read more >
Creating a React Component Library With Typescript Using ...
How to build a reusable component library, publish and automate the release flow. One of the beauties of React is component reusability, which ......
Read more >
A Guide For Migrating Your Project to TypeScript - Xiaoyun Yang
Introduction to TypeScript and guide for how to migrate your project from Flow to TypeScript. This post is a WIP.
Read more >
6 Tools for Documenting Your React Components Like a Pro
Tools for documenting React UI components in 2019. Document components with Bit, StoryBook, StyleGuidist, Docz, MDX-docs, React docgen and ...
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