Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: handle styled component #51

Open
ethange7 opened this issue May 31, 2022 · 2 comments
Open

Feature request: handle styled component #51

ethange7 opened this issue May 31, 2022 · 2 comments

Comments

@ethange7
Copy link

Is there anyway we can track the styled component to it's origin? See example below

import {Button} from 'design-system'
import {styled} from 'react-emotion'
...
const StyledButton = styled(Button)`
//some css here
`
const Container = () => {
    return <StyledButton>
}

in this case, I would consider StyledButton IS Button from 'design-system'
but in the generated report, I think we are only getting

{
  "StyledButton": 1
}

is there any way we can detect this type of situation?

@ethange7
Copy link
Author

getComponentName: ({ imported, local, moduleName, importType }) => {
    return `${moduleName}: ${imported || local}`;
  },

is what I used in the config, I want to be able to tell where is this component from

@smol-honk
Copy link

I sort-of-ish tried to create a PR for this situation. Can definitely get some extra eyes/fingers on it tho. #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants