-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 🎸 make item and itemContent props customizable (#25) * fix: 🐛 fix type inference for props Fix the broken type inference caused by using forwardRef. See: https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/#generic-forwardrefs * feat: 🎸 make item and itemContent props customizable Add getItemProps and getItemContentProps to allow customizing the props of the wrapper item and the item content ✅ Closes: #21 * refactor: clean code --------- Co-authored-by: blaiseludvig <[email protected]>
- Loading branch information
1 parent
8c77b05
commit 9288ad9
Showing
4 changed files
with
1,423 additions
and
1,584 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
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
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,10 @@ | ||
import 'react' | ||
|
||
// Redecalare forwardRef to restore type inference on the forwarded component | ||
// see: https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/#generic-forwardrefs | ||
declare module 'react' { | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
function forwardRef<T, P = {}>( | ||
render: (props: P, ref: React.Ref<T>) => React.ReactElement | null, | ||
): (props: P & React.RefAttributes<T>) => React.ReactElement | null | ||
} |
Oops, something went wrong.