question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flow 0.91.0 with styled-component reports Cannot call styled because a callable signature is missing in object type

See original GitHub issue

Just upgraded to the latest version of flow 0.91.0 and it breaks everywhere I use ‘styled()’

Cannot call styled because a callable signature is missing in object type [1].

export const StyledComponent = styled(MyComponent)`
  font-size: 12px;
`

Detailed error message:

Cannot call `styled` because: Either a callable signature is missing in  object type [1]. Or  `React.ComponentType` [2] is incompatible with  object type [3] in the first argument. Or  `React.ComponentType` [2] is incompatible with  `React.StatelessFunctionalComponent` [4] in the first argument. Or  `React.ComponentType` [2] is incompatible with  `$npm$styledComponents$ReactComponentClass` [5] in the first argument. Or  `React.ComponentType` [2] is incompatible with  `$npm$styledComponents$ReactComponentClassUndefinedDefaultProps` [6] in the first argument.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:16
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pascalduezcommented, Mar 29, 2019

There’s an ongoing work in #3228

I’m sure review, tests, help would be welcome 😉

0reactions
pascalduezcommented, Aug 9, 2019

Closing in hope #3228 solves the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot call `data` because a callable signature is missing in ...
I am trying to declare the type of a function that can take function or object as a parameter, but the result is...
Read more >
types/styled-components - npm
Start using @types/styled-components in your project by running `npm i @types/styled-components`. There are 2009 other projects in the npm ...
Read more >
Tooling - styled-components
By adding a unique identifier to every styled component, this plugin avoids checksum mismatches due to different class generation on the client and...
Read more >
styled component cannot be used as a jsx component - You.com
I am trying to start a React application locally but it fails to build, almost all components have the error 'Component' cannot be...
Read more >
styled-components | Yarn - Package Manager
Because styled -components allows any kind of prop to be used for styling (a trait shared by most CSS-in-JS libraries, but not the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found