flow-typed: Styled-components default export is unknown type
Why default export of the styled-components package is unknown.
Example code:
// @flow
import * as React from 'react';
import styled from 'styled-components';
const A = styled.a`
color: red;
`;
const B: React.ComponentType<{ children: React.Node }> = ({ children }) => (
<a>{children}</a>
);
const C = styled(B)`
color: blue;
`;
styled is typed as unknown, maybe this is because of weird $call property in module.exports. This refers to https://github.com/facebook/flow/issues/2966.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (7 by maintainers)
I think I hit the same issue when updating Flow to
0.75.0. I now get:@shrynx can you please share the hotfix so I can test it?
@shrynx tried to
killall flow, restarting flow server, nothing changed.@dashed It’s not a type error, it’s a coverage warning. My editor is using flow to get file flow coverage.