Skip to content

Commit 3e72ff6

Browse files
committed
hashHistory fix
1 parent ba985f0 commit 3e72ff6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

app/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { Router, Route, IndexRoute } from 'react-router'
3+
import { Router, Route, IndexRoute, hashHistory } from 'react-router'
44

55
import iClientComponent from './components/iClient/iClientComponent';
66
import HomeComponent from './components/Home/HomeComponent';
77
import ClientComponent from './components/Client/ClientComponent';
88

99
ReactDOM.render(
1010
<section className="hero is-fullheight is-primary">
11-
<Router>
11+
<Router history={hashHistory} >
1212
<Route path="/" component={iClientComponent} >
1313
<IndexRoute component={HomeComponent} />
1414
<Route path="client" component={ClientComponent} />

app/components/Client/ClientComponent.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ class ClientComponent extends React.Component{
1313

1414
getClients() {
1515
iClientClient.getClients().then((response) => {
16-
console.log(response);
1716
this.setState({clients: response.data.clients});
1817
});
1918
}
2019

2120
render() {
2221
const clientList = this.state.clients.map((client, key) => {
2322
return (
24-
<tr>
23+
<tr key={key} >
2524
<td>{ client.name }</td>
2625
<td>{ client.address }</td>
2726
<td>{ client.city }</td>

0 commit comments

Comments
 (0)