javascript - How do I remove custom props from a Rebass element extended with styled-components? -


i want create reusable "iconbutton" using styled-components extend rebass button, i'm getting warning:

unknown props 'small, 'overlay' on <button> tag. remove these props element

how remove these props element?

export default ({   ...props,   type,   action,   top,   small,   overlay }) =>   <iconbutton     onclick={() => action()}     px={3}     mt={top && 2}     small={small}     overlay={overlay}>     {icons[type]()}   </iconbutton>;  const iconbutton = styled(button)`   background: ${({ overlay }) => (overlay ? "white" : "transparent")};   svg {     height: ${props =>       props.small ? props.theme.fontsizes[4] : props.theme.fontsizes[5]}px;     width: ${props => props.theme.fontsizes[5]}px;   } `; 


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -