diff --git a/packages/core/src/testers/testers.ts b/packages/core/src/testers/testers.ts index afd96335ac..ac2f449b6b 100644 --- a/packages/core/src/testers/testers.ts +++ b/packages/core/src/testers/testers.ts @@ -27,7 +27,6 @@ import isEmpty from 'lodash/isEmpty'; import get from 'lodash/get'; import endsWith from 'lodash/endsWith'; import last from 'lodash/last'; -import isArray from 'lodash/isArray'; import reduce from 'lodash/reduce'; import toPairs from 'lodash/toPairs'; import includes from 'lodash/includes'; @@ -483,7 +482,7 @@ const traverse = ( pred: (obj: JsonSchema) => boolean, rootSchema: JsonSchema ): boolean => { - if (isArray(any)) { + if (Array.isArray(any)) { return reduce( any, (acc, el) => acc || traverse(el, pred, rootSchema), diff --git a/packages/core/src/util/util.ts b/packages/core/src/util/util.ts index 959651e433..ed4eae93d9 100644 --- a/packages/core/src/util/util.ts +++ b/packages/core/src/util/util.ts @@ -24,7 +24,6 @@ */ import isEmpty from 'lodash/isEmpty'; -import isArray from 'lodash/isArray'; import includes from 'lodash/includes'; import find from 'lodash/find'; import { resolveData, resolveSchema } from './resolvers'; @@ -100,7 +99,7 @@ export const deriveTypes = (jsonSchema: JsonSchema): string[] => { if (!isEmpty(jsonSchema.type) && typeof jsonSchema.type === 'string') { return [jsonSchema.type]; } - if (isArray(jsonSchema.type)) { + if (Array.isArray(jsonSchema.type)) { return jsonSchema.type; } if ( diff --git a/packages/react/src/Renderer.tsx b/packages/react/src/Renderer.tsx index b07cdca198..1ba4c59822 100644 --- a/packages/react/src/Renderer.tsx +++ b/packages/react/src/Renderer.tsx @@ -46,9 +46,10 @@ export class RendererComponent< * Stateless Renderer. * * @template P type of any renderer props + * @deprecated Use React.FunctionComponent instead */ export type StatelessRenderer
= - React.StatelessComponent
; + React.FunctionComponent
;
/**
* Represents a Renderer, which might either be a component or a function.
@@ -57,4 +58,4 @@ export type Renderer =
// TODO fix @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types
| RendererComponent