react-scanner icon indicating copy to clipboard operation
react-scanner copied to clipboard

Feature request: handle styled component

Open ethange7 opened this issue 2 years ago • 2 comments

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 avatar May 31 '22 21:05 ethange7

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

ethange7 avatar May 31 '22 21:05 ethange7

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

smol-honk avatar Oct 25 '22 03:10 smol-honk