diff --git a/src/js/app.jsx b/src/js/app.jsx index 6d76891..637c705 100644 --- a/src/js/app.jsx +++ b/src/js/app.jsx @@ -30,8 +30,8 @@ class App extends React.Component { style={ {fontWeight: 300} } offset={ -20 } onUpdate={ - () => { - console.log(this) + (el) => { + console.log(el) } } > diff --git a/src/js/lib/Scrollspy.jsx b/src/js/lib/Scrollspy.jsx index 91e26ac..73a20c4 100644 --- a/src/js/lib/Scrollspy.jsx +++ b/src/js/lib/Scrollspy.jsx @@ -205,7 +205,7 @@ export default class Scrollspy extends React.Component { return } - this.props.onUpdate() + this.props.onUpdate(this.state.targetItems[this.state.inViewState.indexOf(true)]) } _handleSpy () {