This code is taken from react-table row selection example. https://react-table.tanstack.com/docs/examples/row-selection
What is the purpose of the indeterminate
argument in this function?
const IndeterminateCheckbox = React.forwardRef(
({ indeterminate, ...rest }, ref) => {
const defaultRef = React.useRef()
const resolvedRef = ref || defaultRef
React.useEffect(() => {
resolvedRef.current.indeterminate = indeterminate
}, [resolvedRef, indeterminate])
console.log(resolvedRef)
console.log(indeterminate)
return (
<>
<input type="checkbox" ref={resolvedRef} {...rest} />
</>
)
}
)