Update test

This commit is contained in:
Kodai Nakamura
2018-08-15 15:33:48 +09:00
parent 3961ab3484
commit 32e4b4da23
+10 -3
View File
@@ -1,4 +1,10 @@
import { Link, Location, RouteComponentProps, Router } from "@reach/router";
import {
Link,
Location,
RouteComponentProps,
Router,
Redirect
} from "@reach/router";
import * as React from "react";
import { render } from "react-dom";
@@ -21,9 +27,10 @@ render(
<NotFound default />
<Link to="/somepath" rel="noopener noreferrer" target="_blank" />
<Redirect to="/somepath" replace={false} state={{ from: "/" }} />
<Location>
{(context) => (
{context => (
<>
<div>hostname is {context.location.hostname}</div>
<button onClick={() => context.navigate("/")}>
@@ -33,5 +40,5 @@ render(
)}
</Location>
</Router>,
document.getElementById("app-root"),
document.getElementById("app-root")
);