Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 904c722

Browse files
committed
pass active el
1 parent eb21c16 commit 904c722

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/js/app.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class App extends React.Component {
3030
style={ {fontWeight: 300} }
3131
offset={ -20 }
3232
onUpdate={
33-
() => {
34-
console.log(this)
33+
(el) => {
34+
console.log(el)
3535
}
3636
}
3737
>

src/js/lib/Scrollspy.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default class Scrollspy extends React.Component {
205205
return
206206
}
207207

208-
this.props.onUpdate()
208+
this.props.onUpdate(this.state.targetItems[this.state.inViewState.indexOf(true)])
209209
}
210210

211211
_handleSpy () {

0 commit comments

Comments
 (0)