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.

Select component validation example?

See original GitHub issue

Hello,

I am trying to look for an example in the documentation that shows the usage of a Select Drop-down being required. In my scenario I have a select drop down for gender:

<Select>
  <option value='male'>male</option>
  <option value='female'>female</option>
  <option value='other'>other</option>
</Select>

How can I accomplish this?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
joepuzzocommented, Oct 8, 2018

Yup so you can pass a validation function to any type of input. For select its on the Select comp. just like all the others. Same interface

0reactions
joepuzzocommented, Oct 10, 2018

That is fine yes!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I implement field validation for 'react-select'
Example here. As you want to custom the original select I would recommend to embed your customSelect in a separate file.
Read more >
How to validate react-select dropdown in React - Clue Mediator
Steps to validate react-select dropdown in React. Create a common Select component; Create a form using the Select component; Output. 1. Create ...
Read more >
Validate react-select dropdown in React - Clue Mediator
A create-react-app project based on react and react-dom.
Read more >
How to make react-select required in a form? #3140 - GitHub
I make a wrapper component and give the Select a className like ... Therefore using react-hook-form 's validation to require the value at ......
Read more >
Get Started | React Hook Form - Simple React forms validation
The following code excerpt demonstrates a basic usage example: ... to avoid working with external controlled components such as React-Select, AntD and MUI....
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