-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
refactor(dashboard): Migrate ResizableContainer to TypeScript and functional component #31452
base: master
Are you sure you want to change the base?
refactor(dashboard): Migrate ResizableContainer to TypeScript and functional component #31452
Conversation
- Refactoring the component to use React functional component syntax - Defining TypeScript interfaces for props and state - Adding type safety throughout the component
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.
LGTM. I'd love a feedback from @kgabryje too before merging
width: adjustableWidth ? nextWidthMultiple : 0, | ||
height: adjustableHeight ? nextHeightMultiple : 0, | ||
}, | ||
// @ts-ignore |
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.
ResizeCallback type does not expect the id, but in our case it is required until it is modified in handleResizeStop.
Instead of using ResizeCallback, I can create a custom type if we think it might be useful.
superset-frontend/src/dashboard/components/resizable/ResizableContainer.jsx
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx
Outdated
Show resolved
Hide resolved
…vent unnecessary re-renders
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.
lgtm
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before.mp4
after.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION