martyjs / marty

A Javascript library for state management in React applications
http://martyjs.org
MIT License
1.09k stars 76 forks source link

marty context ( Store.for(this).getItem() ) in Docs #315

Closed SimonErich closed 9 years ago

SimonErich commented 9 years ago

Hi James,

I've been having a bit of trouble with the for(this) context in isomorphic applications. Although I had the "for(this)" there I still got the "You are calling method on the static instance ..." error, I searched the docs and I didn't know what was wrong.

I figured it out now: I was using the react-router context as well and that was (sadly not obviously enough) overwriting the marty context. Now I added the marty context in there as well and it's working now. contextTypes: { router: React.PropTypes.func, marty: React.PropTypes.object },

Maybe you could drop a line about that at the end of the isomorphic guide to save somebody else the trouble :)

jhollingworth commented 9 years ago

You're not the first to be having some troubles with this isomorphic stuff. Thats why we're moving to a simpler approach for v0.10 which should be released imminently.

In the mean time I will update the docs, thanks!

SimonErich commented 9 years ago

Thanks man. this is closed :)