question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation for @PropValidator

See original GitHub issue

It 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:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
slavapcommented, Dec 13, 2017

@adrienbaron Not sure I can contribute currently with the code, but I have such plans for 2018.

0reactions
slavapcommented, Jan 18, 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found