-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(ui-kit): checkbox 스토리 수정 * fix(ui-kit): 스토리에 uncontrolled 코드 부분 추가
- Loading branch information
Showing
2 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { useState } from 'react'; | ||
import { Checkbox, Text } from 'src'; | ||
|
||
export const Controlled = () => { | ||
const [state, setState] = useState(false); | ||
return ( | ||
<div> | ||
<Text>Controlled state: {`${state}`}</Text> | ||
<Checkbox label={'체크박스'} onChange={(e) => setState(e.target.checked)} checked={state} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export const Uncontrolled = () => { | ||
const [state, setState] = useState(false); | ||
return ( | ||
<div> | ||
<Text>Uncontrolled state: {`${state}`}</Text> | ||
<Checkbox label={'체크박스'} onChange={(e) => setState(e.target.checked)} /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters