typed-typings / npm-ramda

TypeScript's type definitions for Ramda
MIT License
384 stars 64 forks source link

Expected 0 arguments, but got 1 #446

Open Brad19 opened 4 years ago

Brad19 commented 4 years ago

Hi I've a new react app with typescript template and have the following config. I'm getting Expected 0 arguments, but got 1. Can some one please advise.

package.json dependencies : { "ramda": "0.27.0", } "devDependencies": { "@types/ramda": "0.27.4" }

This is my RootApp.tsx

import React from 'react';. import {compose} from 'ramda';. import {withSDKContextProvider} from '@contexts/SDKContext';. const RootApp: React.SFC = () => (. `

This is the home page of the app

</div>`. 

);. export default compose<any>( withSDKContextProvider )(RootApp);.

It is throwing error as "Expected 0 arguments, but got 1." Please note this error is not thrown in .js file.

This withSDKContextProvider is a wrapper component and this is how it is

export const withSDKContextProvider = WrappedComponent => {. return class extends React.Component {. render() {. return (. <SDKContextProvider>. <WrappedComponent {...this.props} />. </SDKContextProvider>. );. }. };. };.

@tycho01 / @ikatyang Can you guys or some one please advise. I'm very new to this ramda eco system

KiaraGrouwstra commented 4 years ago

hey! I'm under the impression that at this point the Ramda typings over at DefinitelyTyped have outpaced the ones of this repo.

If @ikatyang would be cool with it, perhaps we could put a note to that extent in the readme...

Brad19 commented 4 years ago

@tycho01 Thanks for your response. So is this usage right?
I'm checking this one - https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/compose-function/compose-function-tests.ts. Should i use composeFunction rather than compose?

export default compose<any>( withSDKContextProvider )(RootApp);. // This is the place of error as mentioned above

Please advise an alternative or point me what should i do as i'm new to this.

KiaraGrouwstra commented 4 years ago

hm. I'm not sure either, but you can try. for questions on their types tho, you might be better off creating an issue over there...