-
Notifications
You must be signed in to change notification settings - Fork 509
feat: migrate box component to typescript #2370
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
base: main
Are you sure you want to change the base?
Conversation
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.
thanks for this!! just a few minor changes requested
<section | ||
className={className} | ||
style={{ background: '#fbfbfb', ...style }} | ||
{...props} |
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.
adding ...props
here is probably the right thing to do that we weren't previously doing, but: are we receiving extra props that will change the display unexpectedly?
@@ -1,6 +1,6 @@ | |||
import React from 'react' | |||
import { withTranslation, Trans } from 'react-i18next' | |||
import Box from '../box/Box.js' | |||
import Box from '../box/Box' |
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.
we should include the file extension on the import
interface BoxProps { | ||
className?: string; | ||
style?: React.CSSProperties; | ||
children: ReactNode; | ||
[key: string]: any; // For any additional props |
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.
if available,
interface BoxProps { | |
className?: string; | |
style?: React.CSSProperties; | |
children: ReactNode; | |
[key: string]: any; // For any additional props | |
interface BoxProps extends ComponentProps<'section'> { | |
className?: string; | |
style?: React.CSSProperties; | |
children: ReactNode; |
or use explicit types
Migrate Box Component to TypeScript
Changes
Box
component from JavaScript to TypeScriptRelated Issues