Skip to content

Commit

Permalink
build: resolve ts problems
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJim committed Oct 25, 2022
1 parent 79716ad commit 40cf1b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/collapse/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ const Collapse = function(props: CollapseProps) {
if (!React.isValidElement(child)) {
return child;
}
return React.cloneElement(child, {value: index})
const childProps = { value: index }
return React.cloneElement(child, childProps)
})}
</CollapseContext.Provider>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/picker/PickerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ const PickerView: FC<PickerViewProps> = (props) => {
if (isUndefined(innerValue[index])) {
innerValue[index] = innerDefaultValue[index];
}
return React.cloneElement(child, {
const childProps = {
value: value && value[index],
defaultValue: innerDefaultValue[index],
itemIndex: index,
});
};
return React.cloneElement(child, childProps);
});

const [internalValue, setInternalValue] = useDefault(innerValue, innerDefaultValue, onChange);
Expand Down
2 changes: 1 addition & 1 deletion src/textarea/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface TdTextareaProps {
* 是否自动增高,值为 autosize 时,style.height 不生效
* @default false
*/
autosize?: boolean;
autosize?: boolean | { minRows?: number; maxRows?: number };
/**
* 是否禁用文本框
* @default false
Expand Down

0 comments on commit 40cf1b5

Please sign in to comment.