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

More robust prop validation with components #58

Open
nwinch opened this issue May 2, 2016 · 0 comments
Open

More robust prop validation with components #58

nwinch opened this issue May 2, 2016 · 0 comments

Comments

@nwinch
Copy link
Contributor

nwinch commented May 2, 2016

React has some great validation rules for props, and also allows custom validation rules and I think we should utilise this as much possible.

It provides us free, built-in validation for any corrupt data that might get put into the API, or messed up with a migration etc.. and this has been one of the main gripes with Keystone. If we can see data throwing errors in the browser console (or perhaps kick that out to the UI in some way) first thing when entering the admin it could save us hours of time attempting to debug busted data.

Ideally, data will be validated/sanitized before it gets into the API, though if it does pass through the keeper then at least we can verify the dodgy bits easily.

This is especially useful for any props that represent a schema - something like react-prop-schema could be used.

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