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 {join} from 'path';
|
||||||
|
|
||||||
|
import {Context} from '@avocado/behavior';
|
||||||
import {PropTypes, React} from '@latus/react';
|
import {PropTypes, React} from '@latus/react';
|
||||||
import {
|
import {
|
||||||
Number,
|
Number,
|
||||||
|
@ -109,8 +110,14 @@ const Literal = ({
|
||||||
value={null === value ? [0, 0] : value}
|
value={null === value ? [0, 0] : value}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
default:
|
case 'function':
|
||||||
|
case 'null':
|
||||||
|
case 'array':
|
||||||
return null;
|
return null;
|
||||||
|
default:
|
||||||
|
return 'undefined' !== typeof value
|
||||||
|
? valueComponent(path, Context.inferTypeOf(value), {value})
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user