Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit c55554b

Browse files
committed
ISSUE-1463: Fixed undefined prop type error
1 parent ac824ef commit c55554b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/terra-props-table/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Changelog
33

44
Unreleased
55
----------
6+
### Removed
7+
* Implicit inferring of an `enum`'s type based on its first child.
68

79
2.12.0 - (July 10, 2018)
810
------------------

packages/terra-props-table/src/PropsTable.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,8 @@ function formatShape(shape) {
2626
function determineType(type) {
2727
let typeName = type.name;
2828

29-
// Pull the first value off and use that as type.
30-
// This assumes all enumerable values are the same type.
3129
if (typeName === 'enum') {
32-
if (isNaN(type.value[0].value)) {
33-
typeName = typeof type.value[0].value;
34-
} else {
35-
typeName = 'number';
36-
}
30+
typeName = 'enum';
3731
} else if (typeName === 'arrayOf') {
3832
if (type.value.name === 'shape') {
3933
typeName = <span> array of objects structured like: <pre className={cx('props-table-pre')}> {formatShape(type.value.value)} </pre></span>;

0 commit comments

Comments
 (0)