-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create infinite autofill component #305
base: main
Are you sure you want to change the base?
Conversation
# InfiniteAutoFill | ||
|
||
Uses the AutoFill to repeat children to fill the parent element in given axis. In addition to that | ||
it adds the children one more time to the end of the list. This can be useful for example marquee's. |
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.
it adds the children one more time to the end of the list. This can be useful for example marquee's. | |
it adds the children one more time to the end of the list. This can be useful for example marquees or infinite carousels. |
function DemoComponent() { | ||
return ( | ||
<div style={{ height: 1000, outline: '1px solid black' }}> | ||
<InfiniteAutoFill> |
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.
Missing y
axis.
/** | ||
* Repeats children to fill the parent element in given axis. | ||
*/ | ||
export function InfiniteAutoFill({ children, axis = 'x' }: InfiniteAutoFillProps): ReactElement { |
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.
Do we want to "copy" the default here? Making it undefined is enough IMO.
ref: RefCallback<unknown>; | ||
}; | ||
|
||
type InfiniteAutoFillProps = { |
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 use the AutoFillProps instead of copying them, so this will be in sync if the others are updated.
ref: RefCallback<unknown>; | ||
}; | ||
|
||
type InfiniteAutoFillProps = { |
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.
type InfiniteAutoFillProps = { | |
type InfiniteAutoFillProps = ComponentProps<typeof AutoFill>; |
66510e9
to
09c9721
Compare
09c9721
to
168e305
Compare
No description provided.