Skip to content

Commit da905a9

Browse files
committed
Add method description
1 parent f0b18b5 commit da905a9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/utils/get-element-type.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
const {elementType, getProp, getPropValue} = require('jsx-ast-utils')
22

3+
/*
4+
Allows custom component to be mapped to an element type.
5+
When a default is set, all instances of the component will be mapped to the default.
6+
If a prop determines the type, it can be specified with `props`.
7+
8+
For now, we only support the mapping of one prop type to an element type, rather than combinations of props.
9+
*/
310
function getElementType(context, node) {
411
const {settings} = context
512
const rawElement = elementType(node)

0 commit comments

Comments
 (0)