Fix history warning when opening entry.

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.
This commit is contained in:
Caleb 2017-10-24 19:37:34 -06:00
parent 2abdd34502
commit b9fdaec8b7

View File

@ -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 &&