react-validator
react-validator copied to clipboard
Can't use with functional components?
I'm getting this error
Uncaught TypeError: getAllSupportedComponent()[this.typeOfCompnent] is undefined
render index.js:412
React 11
unstable_runWithPriority scheduler.development.js:653
React 6
And on my App.tsx I've done
function App() {
fieldValidatorCore.addSupport('TextField', (args: any) => {
return args[0].target.value;
}, (callback: any, args: any) => {
callback(args[0]);
}, 'error', 'helperText');
// ...
I've also tried to put it inside a useEffect function and same error persists.
Has this been tested with functional components?
Thanks!
did you get a solution to this?