Skip to content

Commit

Permalink
Update README.md [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-moon authored Feb 17, 2021
1 parent 4c79576 commit 766105f
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ import { Toast } from '@lubycon/ui-kit';
function Foo() {
const [show, setShow] = useState(false);

return <Toast show={show} message="토스트입니다" />;
return (
<>
<Button onClick={() => setShow(true)}>토스트 열기</Button>
<Toast show={show} message="토스트입니다" />
</>
);
}

export default Foo;
Expand All @@ -78,18 +83,21 @@ export default Foo;
#### Hooks

```jsx
import React, { useState } from 'react';
import { Toast, Button } from '@lubycon/ui-kit';
import React from 'react';
import { useToast, Button } from '@lubycon/ui-kit';

function Foo() {
const { openToast } = useToast();
const handleClick = () => {
openToast({
message: '토스트입니다',
});
};

return <Button onClick={handleClick}>토스트 열기</Button>;
return (
<Button onClick={() => {
openToast({
message: '토스트입니다',
});
}}>
토스트 열기
</Button>
);
}

export default Foo;
Expand Down

0 comments on commit 766105f

Please sign in to comment.