Skip to content

Commit

Permalink
fix: resolve type errors that occur when strict is true in ts compile…
Browse files Browse the repository at this point in the history
…r options
  • Loading branch information
kotarella1110 committed Nov 15, 2023
1 parent 249c698 commit 265dc2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions node_package/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -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<any> | string;

// Keep these in sync with method lib/react_on_rails/helper.rb#rails_context
export interface RailsContext {
Expand Down Expand Up @@ -44,7 +44,7 @@ type CreateReactOutputResult = ServerRenderResult | ReactElement | Promise<strin
type RenderFunctionResult = ReactComponent | ServerRenderResult | Promise<string>;

interface RenderFunction {
(props?: Record<string, unknown>, 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;
Expand Down

0 comments on commit 265dc2a

Please sign in to comment.