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.

Validation in a functional component (when using React Hooks)

See original GitHub issue

I’m using hooks so utilizing functional components. I’m trying to figure out how to define the public isValidated function needed for validations (I don’t think I actually can with a functional component?).

I’ve defined the function internal to the component, both as function isValidated().... and const isValidated = () =>… also defined the function outside the component. Nothing is working. I can’t not use functional component so really hoping I can get this working with this module.

Can someone help?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
arslan-egenienextcommented, Feb 2, 2021

@newbreedofgeek any update on validation for functional components with react hooks

1reaction
newbreedofgeekcommented, Nov 4, 2020

@AbhaysinghBhosale sorry, still working on getting validation to work on hooks component - unfortunately no ETA yet, glad you have a workaround in the meantime

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form Validation in React.js using React Functional ...
In a React component, state is the data context for the views. It is natural to assign the values received from form fields...
Read more >
How To Create and Validate a React Form With Hooks
First, we import the field validators we created previously. After the imports, we have the touchErrors function. It basically loops through the ...
Read more >
Form validation React function component with useState
You can put the validation logic in a separate function and invoke it when textInput changes using an useEffect hook. I hope this...
Read more >
Form Validator / React functional component
React functional component in React Form Validator component ; useState, The useState is a Hook that allows the state to be defined in...
Read more >
Creating Form Validations with React Hooks
In a nutshell, Hooks let you use React's features without classes. They allow for functional components to have a state and utilize lifecycle...
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