refactor: infer literal type if all else fails
This commit is contained in:
parent
ec9eb85659
commit
86a9261edd
|
@ -1,5 +1,6 @@
|
|||
import {join} from 'path';
|
||||
|
||||
import {Context} from '@avocado/behavior';
|
||||
import {PropTypes, React} from '@latus/react';
|
||||
import {
|
||||
Number,
|
||||
|
@ -109,8 +110,14 @@ const Literal = ({
|
|||
value={null === value ? [0, 0] : value}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
case 'function':
|
||||
case 'null':
|
||||
case 'array':
|
||||
return null;
|
||||
default:
|
||||
return 'undefined' !== typeof value
|
||||
? valueComponent(path, Context.inferTypeOf(value), {value})
|
||||
: null;
|
||||
}
|
||||
};
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue
Block a user