Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use instanceOf or shape in context types and add propTypes #145

Open
dantman opened this issue Oct 19, 2015 · 0 comments
Open

Use instanceOf or shape in context types and add propTypes #145

dantman opened this issue Oct 19, 2015 · 0 comments

Comments

@dantman
Copy link

dantman commented Oct 19, 2015

I recently had to track down a fairly cryptic error:

this.getFlux(...).store is not a function

Short story, this error was the result of accidentally passing a promise that resolves to a Fluxxor.Flux instance instead of an actual instance.

I think Fluxxor should do a little more to ensure it is actually working with Fluxxor.Flux instances. Namely instead of using React.PropTypes.object for flux I think it should explicitly make sure that it is a Flux object.

Depending on your stance on cross-realm/multiple-instance handling this can either be done by using React.PropTypes.instanceOf or using a React.PropTypes.shape that looks for the telltale parts of a Flux object like store, stores, etc...

Likewise I think the FluxMixin should also declare propTypes for the props it uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant