-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Radio group implementation #73
Conversation
src/components/radio-group.tsx
Outdated
const checkedItem = useMemo(() => items.findIndex(item => item.checked), [items]) | ||
const [selected, setSelected] = useState(checkedItem) | ||
|
||
const handleKeyDown = (event: any) => { |
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.
const handleKeyDown = (event: any) => { | |
const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => { |
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.
Let's get rid of the any
.
src/components/radio-group.tsx
Outdated
} | ||
|
||
useEffect(() => { | ||
const handleKeyPress = (event: any) => { |
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.
Ditto above. Let's type the event.
Implements a radio group component with according styling for the radio buttons