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.

In Typescript, options parameter is mandatory.

See original GitHub issue

The constructor of SimpleReactValidator set options as an empty object by default.
It’s the same for theses methods :

  • messageWhenPresent
  • messageAlways
  • message

But, in Typescript, the value for options is mandatory.

this.validator = new SimpleReactValidator({}); or this.validator.message("title", this.state.title, 'required', {});

index.d.ts should handle nullable for options so we can use it like this :

this.validator = new SimpleReactValidator(); or this.validator.message("title", this.state.title, 'required');

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
e-gauthiercommented, Sep 5, 2019

Excellent! I’m on it.

0reactions
stuyamcommented, Sep 5, 2019

Deploying in latest version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript Optional Parameters
In this tutorial, you will learn how to use the TypeScript optional parameters for functions.
Read more >
How to pass optional parameters while omitting some other ...
We can get this functionality in TypeScript by adding a ? to the end of parameters we want to be optional. For example,...
Read more >
Typescript Optional Parameters Guide - DotNetPattern
TypeScript is a strong typed language. When we declare parameters for a function then all the parameters are required and client has to...
Read more >
Provide the syntax for optional parameters in TypeScript
In Typescript, “?” represents optional parameters. We use optional parameters when it's not mandatory for that parameter to have a value or ...
Read more >
TypeScript Optional Parameters | Working and Examples
We should note that whenever we are making any parameter as an optional parameter in the function it is a must that any...
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