react-validator icon indicating copy to clipboard operation
react-validator copied to clipboard

Can't use with functional components?

Open lifenautjoe opened this issue 5 years ago • 1 comments

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!

lifenautjoe avatar Jul 06 '20 15:07 lifenautjoe

did you get a solution to this?

musindo avatar Jul 20 '21 20:07 musindo