Skip to content

Commit 33536fb

Browse files
committed
change to hashrouter
1 parent fb56cd5 commit 33536fb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/DesktopContainer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class DesktopContainer extends Component<IProps, IState> {
4343
showFixedMenu = () => this.setState({ fixed: true });
4444

4545
componentDidMount = async () => {
46-
let pathname = window.location.pathname;
46+
let pathname = window.location.hash;
47+
4748
if (pathname.length > 1) {
4849
this.setState({
4950
activeItem: pathname,

src/MobileContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class MobileContainer extends Component<IProps, IState> {
9999
as="a"
100100
href="https://archlinuxstudio.github.io/ArchLinuxTutorial/#/"
101101
target="_blank"
102-
active={this.state.activeItem === homePathName}
103102
>
104103
ALT
105104
</Menu.Item>

src/const.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createMedia } from '@artsy/fresnel';
2-
import { createBrowserHistory } from 'history';
2+
import { createHashHistory } from 'history';
33

44
export const { MediaContextProvider, Media } = createMedia({
55
breakpoints: {
@@ -9,7 +9,7 @@ export const { MediaContextProvider, Media } = createMedia({
99
},
1010
});
1111

12-
export const history = createBrowserHistory();
12+
export const history = createHashHistory();
1313

1414
export const homePathName = '/home';
1515
export const blogListPathName = '/blog_list';

0 commit comments

Comments
 (0)