Skip to content
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

Defintitions for react-router v1.0.0 #6073

Merged
merged 14 commits into from
Nov 26, 2015
Merged

Defintitions for react-router v1.0.0 #6073

merged 14 commits into from
Nov 26, 2015

Conversation

sergey-buturlakin
Copy link
Contributor

Fix #5939

Also definitions for https://www.npmjs.com/package/history provided

@angularsen
Copy link

I'm getting an error with typescript 1.6.2, both with VSCode intellisense and building with browserify + tsify.

TypeScript error: typings/react-router/react-router.d.ts(88,39): Error TS2305: Module '__React' has no exported member 'HTMLAttributesBase'.

I have react-global.d.ts 0.13.3 installed, and I don't see that type in there.

Any ideas?

@angularsen
Copy link

I realized this is based on a newer react.d.ts than what is published. Copied in the latest changes myself.

@ashwinr
Copy link
Contributor

ashwinr commented Oct 3, 2015

any update on when this will be merged?

@vvakame
Copy link
Member

vvakame commented Oct 6, 2015

react-router/react-router.d.ts

to authors(@mrk21 @vasek17). could you review this PR?
👍 or 👎?

check list

  • pass the Travic-CI test?

@stepancar
Copy link
Contributor

i use this definitions. good work

@santialbo
Copy link
Contributor

Can we get this merged?@vvakame

@santialbo
Copy link
Contributor

I just realised that this is also adding another library's type definition (npm history package). There's currently a definition under history but it corresponds to the history.js npm package. Should we rename the existing one to history.js and add history as it's own type definition?

@sergey-buturlakin
Copy link
Contributor Author

It would be theoretically right but in practice will break existing dependencies for number of projects.
I think that new history.js folder should be created and it should contain copy of current definitions, package in history folder need to contain some kind of warning/notification about the package change. After some period (6 months/1 year ...) history folder content will be replaced by npm history library definitions.

@cdroulers cdroulers mentioned this pull request Oct 29, 2015
interface RouteProp {
name?: string;
path?: string;
handler?: React.ComponentClass<any>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This what? NotFoundRouteClass?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The route property handler is now named component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right. Sorry this is the wrong file.

@vvakame
Copy link
Member

vvakame commented Nov 5, 2015

umm... we can't get review by authors.

@sergey-buturlakin please split https://www.npmjs.com/package/history package definition to other pull request first.

@vasek
Copy link
Contributor

vasek commented Nov 13, 2015

Hi guys, sorry for the delay, didn't have time to review.
It works nicely for me, IMO no need to split history to other pull request for now (but we definitely need to solve history vs historyjs issue).
👍

EDIT: Maybe test and eventually adapt with stable react-router v1.0.0?

@niba
Copy link

niba commented Nov 14, 2015

@sergey-buturlakin In new React 0.14 definitions there is no longer definition for HTMLAttributesBase which you use in your react-router definitions

@robyoder
Copy link
Contributor

Just a note: ReactRouter 1.0.0 (stable) was released Monday, Nov 9. Would be great to test it against that release and mark it as 1.0.0 instead of rc1. I'm going to be testing it soon, but not sure how soon or how fully.

}
interface Redirect extends React.ReactElement<RedirectProps> {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should extend React.ComponentClass, rather than React.ReactElement

@sergey-buturlakin
Copy link
Contributor Author

I will update the PR to the latest History and Router versions this week

getQuery(): {};
isActive(to: string, params?: {}, query?: {}): boolean;
interface HistoryRoutes {
isActive(pathname: H.Pathname, query: H.Query): boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query should be optional here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet