Skip to content

Commit 9a384e3

Browse files
committed
Remove example router & use location.hash (gh-pages does not support it)
1 parent 552dc74 commit 9a384e3

File tree

3 files changed

+15
-101
lines changed

3 files changed

+15
-101
lines changed

example/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"@types/react-dom": "link:../node_modules/@types/react-dom",
2020
"react": "link:../node_modules/react",
2121
"react-dom": "link:../node_modules/react-dom",
22-
"react-router-dom": "^5.2.0",
2322
"react-scripts": "link:../node_modules/react-scripts",
2423
"styled-components": "^5.2.1",
2524
"typed-react-form": "link:..",

example/src/index.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ import ReactDOM from "react-dom";
55
import App from "./App";
66
import OneOfObjectForm from "./OneOfObjectForm";
77
import OneOfObjectArrayForm from "./OneOfObjectArrayForm";
8-
import { BrowserRouter as Router, Route } from "react-router-dom";
98

10-
ReactDOM.render(
11-
<Router>
12-
<Route path="/" exact component={App} />
13-
<Route path="/object-types" exact component={OneOfObjectForm} />
14-
<Route path="/object-types-array" exact component={OneOfObjectArrayForm} />
15-
</Router>,
16-
document.getElementById("root")
17-
);
9+
function Router() {
10+
switch (window.location.hash) {
11+
case "#object-types":
12+
return <OneOfObjectForm />;
13+
case "#object-types-array":
14+
return <OneOfObjectArrayForm />;
15+
default:
16+
return <App />;
17+
}
18+
}
19+
20+
ReactDOM.render(<Router />, document.getElementById("root"));

example/yarn.lock

Lines changed: 3 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,13 +1146,6 @@
11461146
dependencies:
11471147
regenerator-runtime "^0.13.4"
11481148

1149-
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1":
1150-
version "7.13.10"
1151-
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d"
1152-
integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw==
1153-
dependencies:
1154-
regenerator-runtime "^0.13.4"
1155-
11561149
"@babel/runtime@^7.10.5":
11571150
version "7.12.13"
11581151
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.13.tgz#0a21452352b02542db0ffb928ac2d3ca7cb6d66d"
@@ -5174,18 +5167,6 @@ hex-color-regex@^1.1.0:
51745167
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
51755168
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==
51765169

5177-
history@^4.9.0:
5178-
version "4.10.1"
5179-
resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
5180-
integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
5181-
dependencies:
5182-
"@babel/runtime" "^7.1.2"
5183-
loose-envify "^1.2.0"
5184-
resolve-pathname "^3.0.0"
5185-
tiny-invariant "^1.0.2"
5186-
tiny-warning "^1.0.0"
5187-
value-equal "^1.0.1"
5188-
51895170
hmac-drbg@^1.0.0:
51905171
version "1.0.1"
51915172
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
@@ -5195,7 +5176,7 @@ hmac-drbg@^1.0.0:
51955176
minimalistic-assert "^1.0.0"
51965177
minimalistic-crypto-utils "^1.0.1"
51975178

5198-
hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0:
5179+
hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0:
51995180
version "3.3.2"
52005181
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
52015182
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
@@ -5880,11 +5861,6 @@ is-wsl@^2.1.1:
58805861
dependencies:
58815862
is-docker "^2.0.0"
58825863

5883-
5884-
version "0.0.1"
5885-
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
5886-
integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
5887-
58885864
[email protected], isarray@^1.0.0, isarray@~1.0.0:
58895865
version "1.0.0"
58905866
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -6749,7 +6725,7 @@ loglevel@^1.6.8:
67496725
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
67506726
integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==
67516727

6752-
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
6728+
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
67536729
version "1.4.0"
67546730
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
67556731
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -6944,14 +6920,6 @@ mimic-fn@^2.1.0:
69446920
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
69456921
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
69466922

6947-
mini-create-react-context@^0.4.0:
6948-
version "0.4.1"
6949-
resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e"
6950-
integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==
6951-
dependencies:
6952-
"@babel/runtime" "^7.12.1"
6953-
tiny-warning "^1.0.3"
6954-
69556923
69566924
version "0.9.0"
69576925
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
@@ -7706,13 +7674,6 @@ [email protected]:
77067674
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
77077675
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
77087676

7709-
path-to-regexp@^1.7.0:
7710-
version "1.8.0"
7711-
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
7712-
integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
7713-
dependencies:
7714-
isarray "0.0.1"
7715-
77167677
path-type@^2.0.0:
77177678
version "2.0.0"
77187679
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
@@ -8788,40 +8749,11 @@ react-error-overlay@^6.0.7:
87888749
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.8.tgz#474ed11d04fc6bda3af643447d85e9127ed6b5de"
87898750
integrity sha512-HvPuUQnLp5H7TouGq3kzBeioJmXms1wHy9EGjz2OURWBp4qZO6AfGEcnxts1D/CbwPLRAgTMPCEgYhA3sEM4vw==
87908751

8791-
react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4:
8752+
react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4:
87928753
version "16.13.1"
87938754
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
87948755
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
87958756

8796-
react-router-dom@^5.2.0:
8797-
version "5.2.0"
8798-
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
8799-
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
8800-
dependencies:
8801-
"@babel/runtime" "^7.1.2"
8802-
history "^4.9.0"
8803-
loose-envify "^1.3.1"
8804-
prop-types "^15.6.2"
8805-
react-router "5.2.0"
8806-
tiny-invariant "^1.0.2"
8807-
tiny-warning "^1.0.0"
8808-
8809-
8810-
version "5.2.0"
8811-
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
8812-
integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==
8813-
dependencies:
8814-
"@babel/runtime" "^7.1.2"
8815-
history "^4.9.0"
8816-
hoist-non-react-statics "^3.1.0"
8817-
loose-envify "^1.3.1"
8818-
mini-create-react-context "^0.4.0"
8819-
path-to-regexp "^1.7.0"
8820-
prop-types "^15.6.2"
8821-
react-is "^16.6.0"
8822-
tiny-invariant "^1.0.2"
8823-
tiny-warning "^1.0.0"
8824-
88258757
"react-scripts@link:../node_modules/react-scripts":
88268758
version "0.0.0"
88278759
uid ""
@@ -9105,11 +9037,6 @@ resolve-from@^4.0.0:
91059037
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
91069038
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
91079039

9108-
resolve-pathname@^3.0.0:
9109-
version "3.0.0"
9110-
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
9111-
integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==
9112-
91139040
91149041
version "3.1.2"
91159042
resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-3.1.2.tgz#235e2c28e22e3e432ba7a5d4e305c59a58edfc08"
@@ -10140,16 +10067,6 @@ timsort@^0.3.0:
1014010067
resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4"
1014110068
integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=
1014210069

10143-
tiny-invariant@^1.0.2:
10144-
version "1.1.0"
10145-
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
10146-
integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==
10147-
10148-
tiny-warning@^1.0.0, tiny-warning@^1.0.3:
10149-
version "1.0.3"
10150-
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
10151-
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
10152-
1015310070
tmp@^0.0.33:
1015410071
version "0.0.33"
1015510072
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
@@ -10524,11 +10441,6 @@ validate-npm-package-license@^3.0.1:
1052410441
spdx-correct "^3.0.0"
1052510442
spdx-expression-parse "^3.0.0"
1052610443

10527-
value-equal@^1.0.1:
10528-
version "1.0.1"
10529-
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
10530-
integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==
10531-
1053210444
vary@~1.1.2:
1053310445
version "1.1.2"
1053410446
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"

0 commit comments

Comments
 (0)