Skip to content

Commit 754fa60

Browse files
authored
Merge pull request #23 from illBeRoy/checkbox-checked-prop
Checkbox Component: Checked prop
2 parents 6d6fa4f + 8aaf3ff commit 754fa60

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/CheckBox/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ViewProps, setProps as setViewProps } from "../View";
55
interface CheckBoxProps extends ViewProps {
66
children?: string;
77
text?: string;
8+
checked?: boolean;
89
}
910

1011
const setProps = (
@@ -15,6 +16,9 @@ const setProps = (
1516
const setter: CheckBoxProps = {
1617
set text(checkboxText: string) {
1718
widget.setText(checkboxText);
19+
},
20+
set checked(isChecked: boolean) {
21+
widget.setChecked(isChecked);
1822
}
1923
};
2024
Object.assign(setter, newProps);

0 commit comments

Comments
 (0)