-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Based on #240
Currently something like this works
/* @flow */
import React from 'react';
import styled from 'styled-components';
type Props = {
bold?: bool,
};
const Text = styled.span`
color: ${props => props.theme.colors.black};
font-family: ${props => props.theme.fontFamily};
font-size: ${props => props.theme.fontSize.text};
font-weight: ${props => props.bold ? props.theme.fontWeight : 'normal'};
line-height: ${props => props.theme.lineHeight};
`;
export default (props: Props) => <Text {...props} />;
Would it be better if we could do something like so?
Props = {
bold?: bool,
};
const default Text = styled.span(Props)`
color: ${props => props.theme.colors.black};
...
`;
//or
const default Text = styled.span({bold?: bool})`
color: ${props => props.theme.colors.black};
...
`;
Just kinda annoying to make another stateless. Thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels