Remove the {...props} pattern and props coupling, and create an eslint rule for that (#1733)
* Remove the {...props} pattern and props coupling, and create an eslint rule for that
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
* Add another test to the new rule
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
---------
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
This commit is contained in:
@ -99,18 +99,21 @@ const StyledBackDrop = styled(motion.div)`
|
||||
type ModalHeaderProps = React.PropsWithChildren & React.ComponentProps<'div'>;
|
||||
|
||||
const ModalHeader = ({ children, ...restProps }: ModalHeaderProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledHeader {...restProps}>{children}</StyledHeader>
|
||||
);
|
||||
|
||||
type ModalContentProps = React.PropsWithChildren & React.ComponentProps<'div'>;
|
||||
|
||||
const ModalContent = ({ children, ...restProps }: ModalContentProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContent {...restProps}>{children}</StyledContent>
|
||||
);
|
||||
|
||||
type ModalFooterProps = React.PropsWithChildren & React.ComponentProps<'div'>;
|
||||
|
||||
const ModalFooter = ({ children, ...restProps }: ModalFooterProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledFooter {...restProps}>{children}</StyledFooter>
|
||||
);
|
||||
|
||||
@ -203,6 +206,7 @@ export const Modal = ({
|
||||
exit="exit"
|
||||
layout
|
||||
variants={modalVariants}
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
{...restProps}
|
||||
>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user