React-router: Flow types for React Router

Created on 16 Mar 2016  路  10Comments  路  Source: ReactTraining/react-router

I've been using and loving Flow in my current work project. I'm trying to incorporate it into all the things.

A new 'flow-typed' repo opened up (https://github.com/flowtype/flow-typed) similar to Typescript's DefinitelyTyped repo. Was wondering if anyone wanted to make or already had a definition file for react-router to contribute before I'm forced to build my own.

As the main routing library in react, it would be nice to have this.

feature

Most helpful comment

+1 for submitting flow definitions to the flow-typed repo.

All 10 comments

I feel like we'd be better off having our Flow definitions in this repo, if applicable, and actually using Flow.

I recall that Redux used Flow at one point, but I see that it got stripped out. @reactjs/redux: what were the issues there?

Would this cause any issues with Typescript users? I know they have a similar central repo of type mappings for various libraries, but I'm not a user, so I don't know how these things interact.

I don't think so. Flow bindings go under src/, but they're stripped out of the transpiled code. Can you find commit/discussion where Flow types were stripped from Redux though?

Given the similarities between Flow and TypeScript, does anyone know if there's a way to generate support for both via one set of annotations?

You should bring that question up on the Flow types repo.

It looks like the concerns there are about not wanting to offer a public API with respect to Flow types. Given that the whole idea of adding type annotations would be to offer a public API, I don't think those concerns are relevant here.

cc @gaearon

I didn't know Flow types. However, I think typings is the most major tool as a type-definition manager.

TSD was de-fact until recently, but no longer active.

We had better manage type-definition using typings.

+1 for submitting flow definitions to the flow-typed repo.

Looks like there's a PR for this at flowtype/flow-typed#284

Was this page helpful?
0 / 5 - 0 ratings