Repository navigation
Conversation
|
@pspeter3 @vsiao could you review this PR? |
There was a problem hiding this comment.
Please don't do this. react-global.d.ts is provided for this purpose.
There was a problem hiding this comment.
How do I reference react-global.d.ts? Do I just need to include it as part of my build?
There was a problem hiding this comment.
I fixed the PR.
What's the thinking behind having multiple .d.ts files?
There was a problem hiding this comment.
- Declaring a global React module means that React may be referenced even when it hasn't been explicitly imported.
- IntelliJ doesn't like it (I don't personally use IntelliJ with react/typescript, but see React: Added Ambient Module Declaration alongside Ambient External Module Declaration #3959 for more context)
d40b6e4 to
dff746a
Compare
|
I took out the commit that exported the |
b40a61b to
8a6b813
Compare
|
I cleaned up the patches and we're down to one error: I don't think this can be avoided, perhaps @vsiao has some ideas for what we can do here. |
|
Do you absolutely need to use context? It's not officially supported so I haven't fleshed out the types for it yet. Try setting |
|
@vsiao Adding a static property breaks compilation - when I add that in, I get:
Here's a component definition in full: This is most definitely related to #3641. I haven't figured out how React Router uses the
Note: The code in the PR right mirrors the approach shown in the React Router docs - https://github.com/rackt/react-router/blob/master/UPGRADE_GUIDE.md |
|
You'll need to type-annotate |
|
Thanks for working with me through this, @vsiao. One difference now that I'm using
|
|
Other than the error above, if I revert back to using an exported version of So, yay, progress! |
8a6b813 to
8440f04
Compare
|
Have we abandoned this pull request? |
|
@vsiao can i merge this PR? |
|
I'd like @pspeter3 to take a look since he knows more about React Router :) |
There was a problem hiding this comment.
Is this right? I don't see willTransitionTo or willTransitionFrom in https://github.com/rackt/react-router/blob/master/modules/components/RouteHandler.js
|
I agree with @vsiao's comments in the code. I'm also interested why React.createElement needed to be overridden. |
|
I merged #4898 . |
This is a new typing for React Router 0.13.
The older copy has been moved to the legacy folder.
Whenever the React typings get updated to include
contexttype information, this typing needs to be updated to reflect that change. Currently,Router.Contextcan only be used via casting, an example can be found insidereact-router-test.ts.