我真的是打字稿世界的初学者,我目前使用的 React Table 库在文档中默认没有类型。
所以,我想请你帮忙将类型添加到IndeterminateCheckbox 方法。
const IndeterminateCheckbox = React.forwardRef(
({ indeterminate, ...rest }, ref) => {
const defaultRef = React.useRef()
const resolvedRef = ref || defaultRef
React.useEffect(() => {
resolvedRef.current.indeterminate = indeterminate
}, [resolvedRef, indeterminate])
return (
<>
<input type="checkbox" ref={resolvedRef} {...rest} />
</>
)
}
)
这是来自 React Table 文档的沙盒链接: https ://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/row-selection-and-pagination?from-embed=&file=/ src/App.js:613-1010
我的第二个问题是:我在哪里可以找到类型并自己添加它们?