Next.js Discord

Discord Forum

Passing a ref to a function may read its value during render

Unanswered
<Milind ツ /> posted this in #help-forum
Open in Discord
Not a nextjs issue but could someone help, i have a react hook form and passed the submit handler to the form component. While this works, the linter is not agreeing on it.

<form
                onSubmit={handleSubmit((data) => handleContactFormSubmit(data))}
                className="flex flex-col w-full gap-5"
            >


98 |
99 | <form
100 | onSubmit={handleSubmit((data) => handleContactFormSubmit(data))}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Passing a ref to a function may read its value during render

i did found github issue which was marked as resolved via PR on react repo: https://github.com/react/react/issues/35040

but i cant seem to resolve this linter.

0 Replies