Better flow support?
See original GitHub issueBased 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?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:32
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to Optimize Cura Support Settings - All3DP
Cura offers a powerful range of settings to play with. Learn about the main Cura support settings and how to best support your...
Read more >How to Get the Best Support Settings For Filament 3D Printing ...
In this article, I'll try to explain what support settings are and how you can get the best support settings for your 3D...
Read more >Detailed Cura Support Settings - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >Better Flow - GitHub
Only ROS frontend supports reading data from the camera. Some useful ROS links: ROS Kinetic installation · ROS Tutorials. Setup with ROS frontend....
Read more >9 Best Prostate Supplements [2022] - Bens Natural Health
After six months, urine flow rate and IPSS ratings improved and reduced ... to improve prostatitis symptoms and support a healthy prostate.
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
This would be really great. I managed to make it work by this:
But then I have an issue with
.extend
and other methods.Are there any new thoughts on this topic? I’m struggling to make props for a styled-component work properly together with Flow. The workaround provided by @malekjaroslav works however this breaks:
I still use the workaround given in the original post