7 changed files with 87 additions and 33 deletions
@ -1,13 +1,21 @@ |
|||
import React from "react" |
|||
import { useLocation } from "react-router-dom" |
|||
import { useLocation, Route, Switch } from "react-router-dom" |
|||
|
|||
function Test() { |
|||
return <div>test</div> |
|||
} |
|||
|
|||
export default function (props: any) { |
|||
let location = useLocation() |
|||
console.log(location) |
|||
console.log(props) |
|||
return ( |
|||
<div className="container mx-auto"> |
|||
<div>About</div> |
|||
<div>22{props.children}</div> |
|||
<Route path="/about/aa" exact={true}> |
|||
<Test></Test> |
|||
</Route> |
|||
</div> |
|||
) |
|||
} |
|||
|
@ -0,0 +1,9 @@ |
|||
import React from "react"; |
|||
|
|||
export default function(){ |
|||
return ( |
|||
<div> |
|||
saadsadsaddddddddddddddddd |
|||
</div> |
|||
) |
|||
} |
@ -0,0 +1,18 @@ |
|||
import React from "react" |
|||
import { useLocation, Route, Switch } from "react-router-dom" |
|||
|
|||
function Test() { |
|||
return <div>test</div> |
|||
} |
|||
|
|||
export default function (props: any) { |
|||
let location = useLocation() |
|||
console.log(location) |
|||
console.log(props) |
|||
return ( |
|||
<div className="container mx-auto"> |
|||
<div>Login</div> |
|||
<div>22</div> |
|||
</div> |
|||
) |
|||
} |
Loading…
Reference in new issue