-
Notifications
You must be signed in to change notification settings - Fork 1
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
Shared type PropsBasedOnComponent #154
base: main
Are you sure you want to change the base?
Conversation
Compiled a new version demo. |
Compiled a new version demo. |
Compiled a new version demo. |
Pull Request Test Coverage Report for Build 4355349209
💛 - Coveralls |
Compiled a new version demo. |
Coverage report
Test suite run success273 tests passing in 41 suites. Report generated by 🧪jest coverage report action from 4654fa5 |
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 PR! here is my review:
// export Col is necessary with PropsBasedOnComponent due to a Storybook bug | ||
export const Col: PropsBasedOnComponent<ColProps, 'div'> = ({ |
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.
should we keep the default export in this case (IMO we shouldn't) and what is the Storybook bug?
type ColBaseProps<E extends React.ElementType> = { | ||
export interface ColProps { |
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.
can you also update Row
and Container
as well?
Pull Request
Description
While developing
Pagination
, it was created a type for getting props based on a passed component props.In the below example,
component
receivesLink
, which has thelink
prop, which then is available on PaginationItem, with this, we have PropsBasedOnComponent.This is also called Polymorphic component.
This change is only to include this generic type for Grid.Col as well.
Type of change
How do I test this
Checklist
Did you remember to take care of the following?
npm i
– for new NPM dependencies.npm run lint
- to check for linting issuesnpm run test
- to run unit testsnpm run test:sh:docker
- to run screenshot tests, detail instructionNew Feature / Bug Fix
Thanks for contributing!