Skip to content

Commit

Permalink
[react-router-dom] Add future object to NavigatorProvider object (#4562)
Browse files Browse the repository at this point in the history
* add missing features

* fix test

---------

Co-authored-by: Brian Chen <brian.chen@gbst.com>
  • Loading branch information
Brianzchen and Brian Chen committed Jan 10, 2024
1 parent 2b4321b commit e194262
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Expand Up @@ -597,6 +597,7 @@ declare module 'react-router-dom' {
basename: string,
navigator: Navigator,
static: boolean,
future: {| v7_relativeSplatPath: boolean |},
|};

declare export var UNSAFE_NavigationContext: React$Context<NavigationContextObject>;
Expand Down
Expand Up @@ -1068,6 +1068,9 @@ describe('react-router-dom', () => {
basename: 'test',
navigator: nav,
static: false,
future: {
v7_relativeSplatPath: true,
},
}}
/>);
const B = (<Comp
Expand All @@ -1080,6 +1083,9 @@ describe('react-router-dom', () => {
basename: 123,
navigator: nav,
static: false,
future: {
v7_relativeSplatPath: true,
},
}}
/>);
const D = (<Comp
Expand All @@ -1088,6 +1094,9 @@ describe('react-router-dom', () => {
// $FlowExpectedError[incompatible-type]
navigator: 'test',
static: false,
future: {
v7_relativeSplatPath: true,
},
}}
/>);
const E = (<Comp
Expand All @@ -1096,6 +1105,18 @@ describe('react-router-dom', () => {
navigator: nav,
// $FlowExpectedError[incompatible-type]
static: 123,
future: {
v7_relativeSplatPath: true,
},
}}
/>);
const F = (<Comp
context={{
basename: 'test',
navigator: nav,
static: false,
// $FlowExpectedError[prop-missing]
future: {},
}}
/>);
});
Expand Down

0 comments on commit e194262

Please sign in to comment.