Open walkerdb opened 4 years ago
cc @omninonsense
Hi @walkerdb!
I'm aware of this issue, but I'm not sure how to fix it. I'm not even sure if it's a bug with the libdef or a bug in Flow.
But, generally, it happens when people forget to call one of the shorthands, e.g:
// Error
const C = styled.div
vs
// Fine
const C = styled.div``
Someone made a stripped down version of the libdef that reproduces the error and they've opened an issue Flow (facebook/flow#8344)
I'm upgrading from an old flow version (v0.79.1
), it took me a while to figure out what was going on. Found out this is causing me issues:
// $FlowFixMe[missing-annot] Upgrade Flow to v0.129.0.
export const MyDiv = styled.div``;
It correctly suppresses the error in the file but bubbles it up to the styled-components
libdef. This doesn't seem like a libdef issue, but rather a flow issue.
Do you want to request a feature or report a bug? Bug in styled-components v5 flow types.
What is the current behavior? Latest styled-components flow types produce a flow error.
To reproduce, just install latest flow, pull down the latest
styled-components
flow types, and run flow.This error will result:
What is the expected behavior? Flow type should be valid
Local Environment Information Flow v. 0.123.0 (also reproduces on at least 0.122.0, haven't tried on others), latest
styled-components
v5 flow types.