Skip to content

Commit

Permalink
Fix history warning when opening entry.
Browse files Browse the repository at this point in the history
When clicking on a entry in the listing, a console error would be logged
by `history` (react-router): "Hash history cannot push state; it is
ignored". This was caused because using `bind` in the click handler
caused the return value to be passed to the `history.push` as the second
param. This was ignored in react-router v2, but gives a warning in v4.
  • Loading branch information
tech4him1 committed Oct 25, 2017
1 parent 2abdd34 commit b9fdaec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/EntryListing/EntryListing.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class EntryListing extends React.Component {
return (
<Card
key={entry.get('slug')}
onClick={history.push.bind(this, path)} // eslint-disable-line
onClick={() => history.push(path)} // eslint-disable-line
className="nc-entryListing-card"
>
{ image &&
Expand Down

0 comments on commit b9fdaec

Please sign in to comment.