chore: migrate Checkbox to tsx (#10453)

This commit is contained in:
Tanmay Laud 2020-07-29 00:16:36 +05:30 committed by GitHub
parent fc28c92f57
commit 9914ae1b52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -17,15 +17,14 @@
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
const propTypes = {
checked: PropTypes.bool.isRequired,
onChange: PropTypes.func.isRequired,
style: PropTypes.object,
};
interface CheckboxProps {
checked: boolean;
onChange: (val?: boolean) => {};
style: object;
}
export default function Checkbox({ checked, onChange, style }) {
export default function Checkbox({ checked, onChange, style }: CheckboxProps) {
return (
<span style={style}>
<i
@ -46,4 +45,3 @@ export default function Checkbox({ checked, onChange, style }) {
</span>
);
}
Checkbox.propTypes = propTypes;