diff --git a/node_package/src/types/index.ts b/node_package/src/types/index.ts index 6ed95ac7a6..49c4891e2b 100644 --- a/node_package/src/types/index.ts +++ b/node_package/src/types/index.ts @@ -1,11 +1,11 @@ -import type { ReactElement, ReactNode, Component, FunctionComponent, ComponentClass } from 'react'; +import type { ReactElement, ReactNode, Component, ComponentType } from 'react'; // Don't import redux just for the type definitions // See https://github.com/shakacode/react_on_rails/issues/1321 /* eslint-disable @typescript-eslint/no-explicit-any */ type Store = any; -type ReactComponent = FunctionComponent | ComponentClass | string; +type ReactComponent = ComponentType | string; // Keep these in sync with method lib/react_on_rails/helper.rb#rails_context export interface RailsContext { @@ -44,7 +44,7 @@ type CreateReactOutputResult = ServerRenderResult | ReactElement | Promise; interface RenderFunction { - (props?: Record, railsContext?: RailsContext, domNodeId?: string): RenderFunctionResult; + (props?: any, railsContext?: RailsContext, domNodeId?: string): RenderFunctionResult; // We allow specifying that the function is RenderFunction and not a React Function Component // by setting this property renderFunction?: boolean;