reflux / refluxjs

A simple library for uni-directional dataflow application architecture with React extensions inspired by Flux
BSD 3-Clause "New" or "Revised" License
5.36k stars 330 forks source link

TypeError: str.listen is not a function #538

Closed coderdave closed 6 years ago

coderdave commented 6 years ago

When using the MyComponent and StatusStore example from the readme, I get the following error:

Unhandled JS Exception: TypeError: str.listen is not a function. (In 'str.listen(onStoreTrigger)', 'str.listen' is undefined)

This error is located at:
    in MyComponent (at NavigatorIOS.ios.js:862)
    in RCTNavItem (at NavigatorIOS.ios.js:854)
    in StaticContainer (at NavigatorIOS.ios.js:853)
    in RCTNavigator (at NavigatorIOS.ios.js:52)
    in NavigatorTransitionerIOS (at NavigatorIOS.ios.js:882)
    in StaticContainer (at NavigatorIOS.ios.js:881)
    in RCTView (at View.js:113)
    in View (at NavigatorIOS.ios.js:917)
    in NavigatorIOS (at index.ios.js:27)
    in App (at renderApplication.js:35)
    in RCTView (at View.js:113)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:113)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:34)

I'm using reflux 6.4.1, react 16.1.1 and react-native 0.50.3 (if that matters).

What am I doing wrong?

coderdave commented 6 years ago

Never mind, I didn't export the store. Although the examples in the readme don't show that, I guess that's assumed.