styled-forward-as
v1.0.0
Published
Forwarding for the as prop in styled-components
Downloads
4
Readme
forwardAs
Forwarding for the as
prop in styled-components a la React.forwardRef
.
import styled from 'styled-components';
import forwardAs from 'styled-forward-as';
const Button = styled.button`
/* styles */
`;
const PrefixButton = forwardAs(({ prefix, children, ...rest }, as) => (
<Button as={as} {...rest}>{prefix}{children}</Button>
))`
/* styles */
`;