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.

Feature: Support flow types

See original GitHub issue

We’ve started using flow at work and find the static type checking useful.

We’re also using babel-plugin-flow-react-proptypes, which generates propTypes based on the flow types of a component, which means we don’t need to worry about duplication and the resulting inconsistency.

The nice thing about flow is that it will check at compile time that the props (or function arguments) are being used consistently with their declared types. So, for example, it would flag places where we assume an optional prop is always defined. (react-datepicker has some such cases, especially for props with defaults)

There are two ways we could support flow:

  1. By adding type declarations but keeping them separate from the code. This would benefit users of the library who use flow.
  2. By adding flow types within the code. This would help users who use flow in addition to helping us catch bugs within the library itself. Less buggy code would also benefit users who don’t use flow.

Of course, I would prefer option 2. 😃 But I’d like to know there is buy-in before I spend too much time working on it. I can start on some of the smaller subcomponents if you’d like to get an idea of what it would look like.

cc @martijnrusschen @rafeememon

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

0reactions
stale[bot]commented, Aug 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flow Types - Salesforce Help
A flow or flow version's type determines which elements and resources are supported and the ways that the flow can be distributed.Required Editions...
Read more >
Object Types - JavaScript. Flow
In Flow, there are two different kinds of object types: exact object types and inexact object types. In general, we recommend using exact...
Read more >
Overview of the different types of flows - Microsoft Learn
You can create cloud flows, desktop flows, or business process flows. Check out this video about the different types of flows.
Read more >
Amazon Connect Flows - AWS Documentation
A flow defines how a customer experiences your contact center from start to finish. At the most basic level, flows enable you to...
Read more >
The Ultimate Guide to Salesforce Flows - Kicksaw
What are the different Flow Types in Salesforce? · Flow actions · Lightning pages · Lightning community pages · Custom Aura components ·...
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