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

Commit 9ad8a80

Browse files
dylanklohrbjankord
authored andcommitted
ISSUE-1463: Fixed undefined prop type error (#1696)
* ISSUE-1463: Fixed undefined prop type error * removed diff file
1 parent 3c43f86 commit 9ad8a80

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/terra-props-table/CHANGELOG.md

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

44
Unreleased
55
----------
6+
### Removed
7+
* Implicit inferring of an `enum`'s type based on its first child.
8+
69
### Changed
710
* Formatting changes per eslint v4 update
811

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 (Number.isNaN(Number(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)