Skip to content

Flow types for React Router #3193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TheSisb opened this issue Mar 16, 2016 · 10 comments
Closed

Flow types for React Router #3193

TheSisb opened this issue Mar 16, 2016 · 10 comments

Comments

@TheSisb
Copy link

TheSisb commented Mar 16, 2016

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.

@taion
Copy link
Contributor

taion commented Mar 16, 2016

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?

@taion taion changed the title Add react-router to flow-typed Flow types for React Router Mar 16, 2016
@timdorr
Copy link
Member

timdorr commented Mar 17, 2016

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.

@taion
Copy link
Contributor

taion commented Mar 17, 2016

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?

@timdorr
Copy link
Member

timdorr commented Mar 17, 2016

reduxjs/redux#299

@timdorr
Copy link
Member

timdorr commented Mar 17, 2016

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?

@taion
Copy link
Contributor

taion commented Mar 17, 2016

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

@iktakahiro
Copy link

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.

@chrisrittelmeyer
Copy link

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

@MoOx
Copy link

MoOx commented Jun 3, 2016

Meanwhile you can use iflow-react-router https://stackoverflow.com/questions/37513785/flow-react-router-required-module-not-found/37622770#37622770

@timdorr
Copy link
Member

timdorr commented Nov 1, 2016

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

@timdorr timdorr closed this as completed Nov 1, 2016
@remix-run remix-run deleted a comment from 0xcaff Jan 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants