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

Config.instanceOf is not validating #227

Closed
AngeloYoun opened this issue Apr 17, 2017 · 1 comment
Closed

Config.instanceOf is not validating #227

AngeloYoun opened this issue Apr 17, 2017 · 1 comment
Labels

Comments

@AngeloYoun
Copy link

AngeloYoun commented Apr 17, 2017

Setting config.instanceOf on a component state or prop doesn't properly validate. When adding logs to the function, the returned function is never ran.

Class Component extends JSXComponent{}

Component.PROPS = {
    foo: Config.instanceOf(class Foo{})
}

<Component foo={'hello'} />

does not throw an error.

bryceosterhaus added a commit to bryceosterhaus/metal.js that referenced this issue May 4, 2017
bryceosterhaus added a commit to bryceosterhaus/metal.js that referenced this issue May 4, 2017
We need to explicity handle use case for each validator since they all work differently. Validators that accept arguments all do something a little different.
@AngeloYoun
Copy link
Author

Thanks :)

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

No branches or pull requests

2 participants