Styled-components default export is unknown type
See original GitHub issueWhy 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Styled-components not exporting - Stack Overflow
import styled from "styled-components"; export default { colors: { black: "rgba(0,0,0,1)", brandPrimary: "rgba(238,120,36,1)", brandPrimaryLight ...
Read more >API Reference - styled-components
This is the default export. This is a low-level factory we use to create the styled.tagname helper methods. Arguments, Description ...
Read more >styled-jsx - npm
In styled-jsx styles can be defined outside of the component's render method or in separate JavaScript modules using the styled-jsx/css library.
Read more >Useful Patterns by Use Case - React TypeScript Cheatsheets
export function Button(props: ButtonProps) { ... Usecase: same as above, but for a React Component you don't have access to the underlying ......
Read more >Portable Text to React - Sanity.io
You can pass an object of components to use, both to override the defaults and to provide components for your custom content types....
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
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.