Documentation for @PropValidator
See original GitHub issueIt would be nice to mention in documentation that validator method should return boolean, i.e.
@PropValidator(propertyName = "size")
boolean sizeValidator(String value) {
return "large".equals(value) || "small".equals(value);
}
Also declare propertyName as default, so it would be possible to use
@PropValidator("size")
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Props | Vue.js
Prop Validation #. Components can specify requirements for their props, such as the types you've already seen. If a requirement is not met,...
Read more >Vue Props Validation - Best Practices - Nordschool
Best Practices. Here are some guidelines I follow myself: Always validate your props. Always have a default value for non-required props.
Read more >How to validate React props using PropTypes - LogRocket Blog
Learn how to validate props with React PropTypes, React's internal mechanism for adding type checking to component props.
Read more >Typechecking With PropTypes - React
Here is an example documenting the different validators provided: import PropTypes from 'prop-types'; MyComponent.propTypes = { // You can declare that a ...
Read more >Validating Props in Vue - Owen Conti
Use Vue's built-in prop validators to validate your component's props. ... you read through Vue's official documentation on prop validation: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@adrienbaron Not sure I can contribute currently with the code, but I have such plans for 2018.
@adrienbaron tested in beta6-snapshot, works, getting error on compile: [ERROR] Method variantValidator annotated with PropValidator must return a boolean. In VueComponent: com.axellience.vuegwtdemo.client.components.bootstrap.JqmButton