You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
What would you like to be added:
add Reference to html node on formRef.current
(i.e formRef.current.el = <form>....</form> )
Why is this needed:
So I can change its style without the need to re-render the parent element
i.e
useEffect(() => formRef.current.el.disabled = isSubmitting, [isSubmitting])
useEffect(() => formRef.current.el.style = { opacity: isSubmitting ? 0.3 : null }, [isSubmitting])
Or what about get inputRefs nodes too?
useEffect(() => {
formRef.current.el.disabled = isSubmitting
formRef.current.fieldsEls.forEach(input => input.disabled = isSubmitting)
}, [isSubmitting])
so there is no need to send isSubmitting for each input and re-render them neither
....
Im struggling to control my parent component to render as minimal as possible, and this improved my renderings
(but accessing my parent element ref:
parentElement.current.querySelector('form'). disabled = isSubmitting
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What would you like to be added:
add Reference to html node on formRef.current
(i.e
formRef.current.el = <form>....</form>
)Why is this needed:
So I can change its style without the need to re-render the parent element
i.e
useEffect(() => formRef.current.el.disabled = isSubmitting, [isSubmitting])
useEffect(() => formRef.current.el.style = { opacity: isSubmitting ? 0.3 : null }, [isSubmitting])
Or what about get inputRefs nodes too?
useEffect(() => {
formRef.current.el.disabled = isSubmitting
formRef.current.fieldsEls.forEach(input => input.disabled = isSubmitting)
}, [isSubmitting])
so there is no need to send isSubmitting for each input and re-render them neither
....
Im struggling to control my parent component to render as minimal as possible, and this improved my renderings
(but accessing my parent element ref:
parentElement.current.querySelector('form'). disabled = isSubmitting
The text was updated successfully, but these errors were encountered: