Checkbox
Summary: _typescript_ Reviewed By: bnelo12 Differential Revision: D16830538 fbshipit-source-id: cb5c104edfd2318c73b6b32adcd86362fc965ec8
This commit is contained in:
committed by
Facebook Github Bot
parent
4dd1a954c9
commit
11f6b84b94
@@ -6,13 +6,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {PureComponent} from 'react';
|
import {PureComponent} from 'react';
|
||||||
import styled from '../styled/index.js';
|
import styled from 'react-emotion';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
type CheckboxProps = {
|
type CheckboxProps = {
|
||||||
/** Whether the checkbox is checked. */
|
/** Whether the checkbox is checked. */
|
||||||
checked: boolean,
|
checked: boolean;
|
||||||
/** Called when a state change is triggered */
|
/** Called when a state change is triggered */
|
||||||
onChange: (checked: boolean) => void,
|
onChange: (checked: boolean) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const CheckboxContainer = styled('input')({
|
const CheckboxContainer = styled('input')({
|
||||||
@@ -25,7 +26,7 @@ const CheckboxContainer = styled('input')({
|
|||||||
* A checkbox to toggle UI state
|
* A checkbox to toggle UI state
|
||||||
*/
|
*/
|
||||||
export default class Checkbox extends PureComponent<CheckboxProps> {
|
export default class Checkbox extends PureComponent<CheckboxProps> {
|
||||||
onChange = (e: SyntheticInputEvent<HTMLInputElement>) => {
|
onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
this.props.onChange(e.target.checked);
|
this.props.onChange(e.target.checked);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ export {default as Tab} from './components/Tab.tsx';
|
|||||||
export {default as Input} from './components/Input.tsx';
|
export {default as Input} from './components/Input.tsx';
|
||||||
export {default as Textarea} from './components/Textarea.tsx';
|
export {default as Textarea} from './components/Textarea.tsx';
|
||||||
export {default as Select} from './components/Select.tsx';
|
export {default as Select} from './components/Select.tsx';
|
||||||
export {default as Checkbox} from './components/Checkbox.js';
|
export {default as Checkbox} from './components/Checkbox.tsx';
|
||||||
|
|
||||||
// code
|
// code
|
||||||
export {default as CodeBlock} from './components/CodeBlock.js';
|
export {default as CodeBlock} from './components/CodeBlock.js';
|
||||||
|
|||||||
Reference in New Issue
Block a user