From 6125ee7236f50e42cd325658bd07706bf70be0a3 Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Tue, 25 Jan 2022 15:56:32 +0200 Subject: [PATCH] chore: improve code for avoid double destruction --- src/components/Schema/Schema.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Schema/Schema.tsx b/src/components/Schema/Schema.tsx index 3dc55497..4657fbb2 100644 --- a/src/components/Schema/Schema.tsx +++ b/src/components/Schema/Schema.tsx @@ -53,7 +53,9 @@ export class Schema extends React.Component> { } return ( > { } if (oneOf !== undefined) { - return ; + return ; } const types = Array.isArray(type) ? type : [type]; if (types.includes('object')) { if (schema.fields?.length) { - return ; + return ; } } else if (types.includes('array')) { - return ; + return ; } // TODO: maybe adjust FieldDetails to accept schema