File tree Expand file tree Collapse file tree
src/theme/JSONSchemaViewer/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function RenderMultipleTypes(props: MultipleTypesProps): JSX.Element {
4242 const { schema, types, nullable } = props
4343
4444 return (
45- < Tabs defaultValue = { types [ 0 ] . value } values = { types } key = { "multiple_types" } >
45+ < Tabs defaultValue = { types [ 0 ] ? .value } values = { types } key = { "multiple_types" } >
4646 { types . map ( ( val ) => (
4747 < TabItem key = { val . value } value = { val . value } >
4848 {
@@ -81,7 +81,7 @@ export default function CreateTypes(props: Props): JSX.Element {
8181 if ( foundTypes . length === 1 || ( hasNull && foundTypes . length === 2 ) ) {
8282 // Either we got the not null type (likely what the final user wants to express)
8383 // Either we consider first entry as fallback if it was a standalone "null"
84- const firstType = foundTypes . find ( ( s ) => s !== "null" ) || foundTypes [ 0 ]
84+ const firstType = ( foundTypes . find ( ( s ) => s !== "null" ) || foundTypes [ 0 ] ) as TypeValues
8585
8686 return (
8787 < RenderSingleType schema = { schema } type = { firstType } nullable = { hasNull } />
You can’t perform that action at this time.
0 commit comments