flowtyped props, how?
See original GitHub issueIs this right?
/* @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} />;
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Components | Flow
Learn how to type React class components and stateless functional components with Flow.
Read more >How to efficiently type your styled-components with Flow
Adding Flow on top of styled components to avoid misusages before they hit production, and make developers' and designers' life easier.
Read more >What is the correct Flow type for the navigation props ... - GitHub
I'm trying to register a screen to a StackNavigator: const SignUpRootNavigator = StackNavigator({ Approval: { screen: Approval }, }); And I ...
Read more >Flow type of Navigation Screen components [React Navigation]
I tried to import type NavigationScreenProp or NavigationScreenProps from @react-navigation/native but Flow announces that there is no such type ...
Read more >Flow - Redux Form
This will give you the types of the props that will be injected into your decorated form component by the reduxForm() higher order...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That LGTM, I wonder if flow understands
propTypes
? /cc @ryyppy @relekang@steida your solution seems working fine, I’m wondering, do you know why you have to wrap the
styled-component
in a functional one to make it working withflow
?