Skip to content

Commit

Permalink
docs: improve generic explanation at readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zeallat committed Jun 11, 2021
1 parent 6b720ca commit 7331986
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Sometimes we may want to return a result from Modal.
```tsx
// Pass the result data type as the first Generic argument.
// In this case, no parameters are used, so the second generic argument does not need to be passed.
// Now, the confirm function passed as props receives the value of the data type declared as generic.
export const useTextInputModal = createUseModal<string>(({confirm, cancel}) => {
const [value, setValue] = useState('');

Expand Down

0 comments on commit 7331986

Please sign in to comment.