TAGS :Viewed: 1 - Published at: a few seconds ago
[ Error (Cannot get property "subscribe" of undefined) in react-redux trySubscribe with Internet Explorer ]
My React won't load on Internet Explorer 10 (Working correctly with Chrome and FF).
I'm getting error :
TypeError: Cannot get property "subscribe" of undefined
at trySubscribe
at componentDidMount
at notifyAll
at close
at closeAll
at perform
at perform
at perform
at m
at close
(translated)
the trySubscribe function is in react-redux ( src/components/connect.js ):
trySubscribe() {
if (shouldSubscribe && !this.unsubscribe) {
this.unsubscribe = this.store.subscribe(this.handleChange.bind(this))
this.handleChange()
}
}
So it seems that this.store is undefined but I don't know why ?
Answer 1
Found it !
I was using a container component extending another container component, and both of them where decorated with @connect
!
So I was trying to @connect
a component which was not part of the components tree !
After removing @connect
from superclass, problem solved !
(Actually I completely removed the superclass (not used anymore) and extended directly Component
).