Skip to content

Stateless Component not recognized #380

Closed
@tongbin

Description

@tongbin

I'm using 5.0.0-beta.1
My component looks like

import { cloneElement } from 'react';
const AnalyticsIdentify = ({children}) => {
 return cloneElement(children, {
    style:{}
  }); 
}

I've looked into /react-docgen/dist/utils/isReactCloneElementCall.js, this usage could not pass

!(0, _match.default)(path.node, {
    callee: {
      property: {
        name: 'cloneElement'
      }
    }
  })

but it could pass test like

!(0, _match.default)(path.node, {
    callee: {
        name: 'cloneElement'
    }
  })

maybe we could be compatible both the cases, or have I get anything wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions