Skip to content

About

Forwarding for the as prop in styled-components

Resources

Contributing

Stars

0 stars

Watchers

7 watching

Forks

Repository files navigation

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 */
`;

About

Forwarding for the as prop in styled-components

Resources

Contributing

Stars

0 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages