Skip to content

Commit

Permalink
Remove react-router-dom shim from website
Browse files Browse the repository at this point in the history
This was only needed when we had our own <FakeBrowser> so it didn't
conflict with the main <Router> on the page. But now that all our
examples run in CodeSandbox, we don't have that problem.
  • Loading branch information
mjackson committed Sep 23, 2019
1 parent c4a89e1 commit 443126b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 36 deletions.
20 changes: 0 additions & 20 deletions website/modules/ReactRouterDOMShim.js

This file was deleted.

12 changes: 3 additions & 9 deletions website/modules/components/App.js
@@ -1,11 +1,5 @@
import React from "react";

// don't want the shimmed one
// eslint-disable-next-line
import { BrowserRouter } from "../../../packages/react-router-dom";

// this stuff is shimmed, see ReactRouterDOMShim.js for more details
import { Switch, Route } from "react-router-dom";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";

import DelegateMarkdownLinks from "./DelegateMarkdownLinks";
import Home from "./Home";
Expand All @@ -14,14 +8,14 @@ import basename from "../basename";

function App() {
return (
<BrowserRouter basename={basename}>
<Router basename={basename}>
<DelegateMarkdownLinks>
<Switch>
<Route path="/" exact={true} component={Home} />
<Route path="/:environment" component={Environment} />
</Switch>
</DelegateMarkdownLinks>
</BrowserRouter>
</Router>
);
}

Expand Down
18 changes: 11 additions & 7 deletions website/webpack.config.js
Expand Up @@ -32,11 +32,11 @@ module.exports = {
].concat(
process.env.NODE_ENV === "production"
? [
new SWPrecacheWebpackPlugin({
cacheId: "react-router-website",
staticFileGlobsIgnorePatterns: [/\.map$/]
})
]
new SWPrecacheWebpackPlugin({
cacheId: "react-router-website",
staticFileGlobsIgnorePatterns: [/\.map$/]
})
]
: []
),

Expand All @@ -49,7 +49,10 @@ module.exports = {
resolve: {
alias: {
"react-router": path.resolve(__dirname, "../packages/react-router"),
"react-router-dom": path.resolve(__dirname, "modules/ReactRouterDOMShim")
"react-router-dom": path.resolve(
__dirname,
"../packages/react-router-dom"
)
}
},

Expand Down Expand Up @@ -114,7 +117,8 @@ module.exports = {
test: /\.md(\?(.+))?$/,
loader: "markdown-loader",
options: {
basename: process.env.NODE_ENV === "production" ? "/react-router" : undefined
basename:
process.env.NODE_ENV === "production" ? "/react-router" : undefined
}
},
{
Expand Down

0 comments on commit 443126b

Please sign in to comment.