diff --git a/types/react-router/test/README.md b/types/react-router/test/README.md deleted file mode 100644 index 341bd29130..0000000000 --- a/types/react-router/test/README.md +++ /dev/null @@ -1 +0,0 @@ -Examples taken from https://github.com/ReactTraining/react-router/tree/22bd52c901ef0312348c2b02549c7102bd5653ae/packages/react-router-website/modules/examples diff --git a/types/react-router/test/Ambiguous.tsx b/types/react-router/test/examples-from-react-router-website/Ambiguous.tsx similarity index 100% rename from types/react-router/test/Ambiguous.tsx rename to types/react-router/test/examples-from-react-router-website/Ambiguous.tsx diff --git a/types/react-router/test/Animation.tsx b/types/react-router/test/examples-from-react-router-website/Animation.tsx similarity index 100% rename from types/react-router/test/Animation.tsx rename to types/react-router/test/examples-from-react-router-website/Animation.tsx diff --git a/types/react-router/test/Auth.tsx b/types/react-router/test/examples-from-react-router-website/Auth.tsx similarity index 100% rename from types/react-router/test/Auth.tsx rename to types/react-router/test/examples-from-react-router-website/Auth.tsx diff --git a/types/react-router/test/Basic.tsx b/types/react-router/test/examples-from-react-router-website/Basic.tsx similarity index 100% rename from types/react-router/test/Basic.tsx rename to types/react-router/test/examples-from-react-router-website/Basic.tsx diff --git a/types/react-router/test/CustomLink.tsx b/types/react-router/test/examples-from-react-router-website/CustomLink.tsx similarity index 100% rename from types/react-router/test/CustomLink.tsx rename to types/react-router/test/examples-from-react-router-website/CustomLink.tsx diff --git a/types/react-router/test/ModalGallery.tsx b/types/react-router/test/examples-from-react-router-website/ModalGallery.tsx similarity index 99% rename from types/react-router/test/ModalGallery.tsx rename to types/react-router/test/examples-from-react-router-website/ModalGallery.tsx index f4b55aca20..211e62aa49 100644 --- a/types/react-router/test/ModalGallery.tsx +++ b/types/react-router/test/examples-from-react-router-website/ModalGallery.tsx @@ -130,7 +130,7 @@ const ImageView: React.SFC> = ({ match }) => const Modal: React.SFC> = ({ match, history }) => { const image = IMAGES[parseInt(match.params.id, 10)]; if (!image) { - return null!; + return null; } const back = (e: React.MouseEvent) => { e.stopPropagation(); diff --git a/types/react-router/test/NoMatch.tsx b/types/react-router/test/examples-from-react-router-website/NoMatch.tsx similarity index 100% rename from types/react-router/test/NoMatch.tsx rename to types/react-router/test/examples-from-react-router-website/NoMatch.tsx diff --git a/types/react-router/test/Params.tsx b/types/react-router/test/examples-from-react-router-website/Params.tsx similarity index 100% rename from types/react-router/test/Params.tsx rename to types/react-router/test/examples-from-react-router-website/Params.tsx diff --git a/types/react-router/test/PreventingTransitions.tsx b/types/react-router/test/examples-from-react-router-website/PreventingTransitions.tsx similarity index 100% rename from types/react-router/test/PreventingTransitions.tsx rename to types/react-router/test/examples-from-react-router-website/PreventingTransitions.tsx diff --git a/types/react-router/test/examples-from-react-router-website/README.md b/types/react-router/test/examples-from-react-router-website/README.md new file mode 100644 index 0000000000..6648c853d0 --- /dev/null +++ b/types/react-router/test/examples-from-react-router-website/README.md @@ -0,0 +1,5 @@ +Examples taken from react-router website. + +Please keep them in sync and as close as possible to the original ones. + +See https://github.com/ReactTraining/react-router/tree/22bd52c901ef0312348c2b02549c7102bd5653ae/packages/react-router-website/modules/examples diff --git a/types/react-router/test/Recursive.tsx b/types/react-router/test/examples-from-react-router-website/Recursive.tsx similarity index 100% rename from types/react-router/test/Recursive.tsx rename to types/react-router/test/examples-from-react-router-website/Recursive.tsx diff --git a/types/react-router/test/RouteConfig.tsx b/types/react-router/test/examples-from-react-router-website/RouteConfig.tsx similarity index 100% rename from types/react-router/test/RouteConfig.tsx rename to types/react-router/test/examples-from-react-router-website/RouteConfig.tsx diff --git a/types/react-router/test/Sidebar.tsx b/types/react-router/test/examples-from-react-router-website/Sidebar.tsx similarity index 100% rename from types/react-router/test/Sidebar.tsx rename to types/react-router/test/examples-from-react-router-website/Sidebar.tsx diff --git a/types/react-router/test/StaticRouter.tsx b/types/react-router/test/examples-from-react-router-website/StaticRouter.tsx similarity index 100% rename from types/react-router/test/StaticRouter.tsx rename to types/react-router/test/examples-from-react-router-website/StaticRouter.tsx diff --git a/types/react-router/tsconfig.json b/types/react-router/tsconfig.json index 4790f0b53d..438e3c9647 100644 --- a/types/react-router/tsconfig.json +++ b/types/react-router/tsconfig.json @@ -14,22 +14,24 @@ }, "files": [ "index.d.ts", - "test/Ambiguous.tsx", - "test/Animation.tsx", - "test/Auth.tsx", - "test/Basic.tsx", + + "test/examples-from-react-router-website/Ambiguous.tsx", + "test/examples-from-react-router-website/Animation.tsx", + "test/examples-from-react-router-website/Auth.tsx", + "test/examples-from-react-router-website/Basic.tsx", + "test/examples-from-react-router-website/CustomLink.tsx", + "test/examples-from-react-router-website/ModalGallery.tsx", + "test/examples-from-react-router-website/NoMatch.tsx", + "test/examples-from-react-router-website/Params.tsx", + "test/examples-from-react-router-website/PreventingTransitions.tsx", + "test/examples-from-react-router-website/Recursive.tsx", + "test/examples-from-react-router-website/RouteConfig.tsx", + "test/examples-from-react-router-website/Sidebar.tsx", + "test/examples-from-react-router-website/StaticRouter.tsx", + "test/Children.tsx", - "test/CustomLink.tsx", - "test/ModalGallery.tsx", "test/NavigateWithContext.tsx", "test/MemoryRouter.tsx", - "test/NoMatch.tsx", - "test/Params.tsx", - "test/PreventingTransitions.tsx", - "test/Recursive.tsx", - "test/RouteConfig.tsx", - "test/Sidebar.tsx", - "test/StaticRouter.tsx", "test/Switch.tsx", "test/WithRouter.tsx" ]