Closed KGALLET closed 8 years ago
console.log(this)
inside setAnimationValue
. where setAnimationValue
called? put debugger
there and inside repl you will easily find out a problem.
setAnimationValue
is called in componentDidMount
, see here :
componentDidMount() {
this.setAnimationValue({ value: this.props.activeTab })
this._listener = this.props.scrollValue.addListener(this.setAnimationValue)
}
Here is my debugger, as you can see my tabIcons array is not empty and not undefined
I'm pretty sure you need this.setAnimationValue.bind(this) when you use ES6 class. React.createClass do the binding of all methods for you.
The code should be:
componentDidMount() {
this.setAnimationValue({ value: this.props.activeTab })
this._listener = this.props.scrollValue.addListener(this.setAnimationValue.bind(this))
}
@vincentfretin thx
Hello,
I've got an issue while trying to use a
CustomBar
with myScrollableTabView
component.Here is my code :
CustomTabBar
Toolbar.android.js
I used the code from FacebookTabBarExample that's why i put '...' .
I got the error :
undefined is not an object (evaluating 'this.tabIcons.forEach')
for thesetAnimationValue
method. I don't know how to solve this, if someone know what's my problem here, it would be nice to help me.thank's