mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-29 12:45:32 +08:00
fix: override types
This commit is contained in:
@@ -20,7 +20,8 @@ const defaultProps = {
|
||||
parentPath: '',
|
||||
}
|
||||
|
||||
export type TreeFileProps = Props & typeof defaultProps & React.HTMLAttributes<any>
|
||||
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
|
||||
export type TreeFileProps = Props & typeof defaultProps & NativeAttrs
|
||||
|
||||
const TreeFile: React.FC<React.PropsWithChildren<TreeFileProps>> = ({
|
||||
name, parentPath, level, extra, className, ...props
|
||||
|
||||
@@ -24,7 +24,8 @@ const defaultProps = {
|
||||
parentPath: '',
|
||||
}
|
||||
|
||||
export type TreeFolderProps = Props & typeof defaultProps & React.HTMLAttributes<any>
|
||||
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
|
||||
export type TreeFolderProps = Props & typeof defaultProps & NativeAttrs
|
||||
|
||||
const TreeFolder: React.FC<React.PropsWithChildren<TreeFolderProps>> = ({
|
||||
name, children, parentPath, level: parentLevel, extra, className, ...props
|
||||
|
||||
@@ -31,7 +31,8 @@ const defaultProps = {
|
||||
className: '',
|
||||
}
|
||||
|
||||
export type TreeProps = Props & typeof defaultProps & React.HTMLAttributes<any>
|
||||
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
|
||||
export type TreeProps = Props & typeof defaultProps & NativeAttrs
|
||||
|
||||
const makeChildren = (value: Array<FileTreeValue> = []) => {
|
||||
if (!value || !value.length) return null
|
||||
|
||||
Reference in New Issue
Block a user