-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: convert useListenFocusTriggers stories file to TS #2492
docs: convert useListenFocusTriggers stories file to TS #2492
Conversation
@LastExileUA @virtser @doronbrikman @jasonbahl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LoayTarek5 thank you for this PR! Looks like there are two similar files and the previous one is missing in this changeset (which means it's not deleted). Let's add the deletion of the old file, and keep only the tsx file here
Thanks!
…ListenFocusTriggers.stories.ts delete the additional file
…ub.com:LoayTarek5/vibe into docs/useListenFocusTriggers-stories-file-to-TS
@LoayTarek5 there is still the old file :( |
…ListenFocusTriggers.stories.js deletion the old file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great @LoayTarek5 ! Just check out my 2 comments, probably unused code
packages/core/src/hooks/useListenFocusTriggers/__stories__/useListenFocusTriggers.stories.tsx
Outdated
Show resolved
Hide resolved
@@ -35,4 +37,4 @@ export const Overview = { | |||
}, | |||
|
|||
name: "Overview" | |||
}; | |||
} as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @LoayTarek5 ! Looks good, please just run prettier on this file as the CI fails for the extra spaces in line 7
Thanks!
run prettier
Here are the main changes made to convert the code to TypeScript:
Added type annotation for the text state: useState("-").
Specified the type for the ref: useRef(null).
Added type annotations for the event parameters in onFocusByMouse and onFocusByKeyboard: React.FocusEvent.
Added an empty interface RenderProps which can be extended later if needed.
Added as const to the Overview object to ensure type inference for its properties.
Resolves #2474