Skip to content

[Bug] Bug in getElementType logic #526

Closed
@khiga8

Description

@khiga8

There appears to be a bug in the getElementType logic.

When the polymorphic prop is set but cannot be interpreted by the linter, the linter falls back to using the value defined in the component map if it is available. This will result in false mappings of components to a value.

The linter should not use the component value at all!

const mapping = {
  'Box': 'div'
}
<Box as={something} />

In this case, Box should not fall back to div, and should be skipped by the linter.

Metadata

Metadata

Assignees

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