0

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;

2 Answers 2

1
const component = (props) => {

    const validate = value => {
        const {
            formApi: { getValue },
            name,
        } = props
    }

}
Sign up to request clarification or add additional context in comments.

Comments

0
const Component = ({formApi: {getValue}, name})=> {
    const validate = useCallback((value)=> {
    }, [getValue, name]);
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.