Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript No overload matches this call. #8

Open
SMKH-PRO opened this issue Aug 25, 2023 · 0 comments
Open

Typescript No overload matches this call. #8

SMKH-PRO opened this issue Aug 25, 2023 · 0 comments

Comments

@SMKH-PRO
Copy link

SMKH-PRO commented Aug 25, 2023

Error:

No overload matches this call.
  Overload 1 of 2, '(props: ITipProvider | Readonly<ITipProvider>): TipProvider', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<TipProvider> & Readonly<ITipProvider>'.
  Overload 2 of 2, '(props: ITipProvider, context: any): TipProvider', gave the following error.
    Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<TipProvider> & Readonly<ITipProvider>'.

My Code:

import React from "react";
import { PersistGate } from "redux-persist/integration/react";
import { Provider } from "react-redux";
import TipProvider from "react-native-tip";
import { store, persistor } from "./src/redux";

type Props = {
  children: JSX.Element;
};
const Providers = ({ children }: Props) => (
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
      <TipProvider>
        {children} 
      </TipProvider>
    </PersistGate>

  </Provider>
);

export default Providers;

Screenshot 2023-08-26 at 1 20 36 AM
@SMKH-PRO SMKH-PRO changed the title Typescript No overload matches this call. Overload 1 of 2, '(props: ITipProvider | Readonly<ITipProvider>): TipProvider', gave the following error. Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<TipProvider> & Readonly<ITipProvider>'. Overload 2 of 2, '(props: ITipProvider, context: any): TipProvider', gave the following error. Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<TipProvider> & Readonly<ITipProvider>'. Typescript No overload matches this call. Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant