i have this code inside a class, how could i keep the idea of it but updating to use in a function component? I'm trying to change but I can't keep the current proposal
validate = value => {
const {
formApi: { getValue },
name,
} = this.props;
CodePudding user response:
const Component = ({formApi: {getValue}, name})=> {
const validate = useCallback((value)=> {
}, [getValue, name]);
}
CodePudding user response:
const component = (props) => {
const validate = value => {
const {
formApi: { getValue },
name,
} = props
}
}