add docstring for new getElementValue function

This commit is contained in:
Masen Furer 2024-10-23 16:10:20 -07:00
parent bb597cf7d6
commit ec91c85c80
No known key found for this signature in database
GPG Key ID: B0008AD22B3B3A95

View File

@ -863,6 +863,11 @@ export const getRefValue = (ref) => {
return getElementValue(ref.current)
}
/**
* Get the form submission value for a given element.
* @param el The element to get the value from.
* @returns The value.
*/
export const getElementValue = (el) => {
if (el.type == "checkbox") {
return el.checked; // chakra