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

Expected 0 arguments, but got 1 #446

Open
Brad19 opened this issue May 12, 2020 · 3 comments
Open

Expected 0 arguments, but got 1 #446

Brad19 opened this issue May 12, 2020 · 3 comments

Comments

@Brad19
Copy link

Brad19 commented May 12, 2020

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 = () => (.
<div> <h4>This is the home page of the app</h4> </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
Copy link
Member

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
Copy link
Author

Brad19 commented May 13, 2020

@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
Copy link
Member

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...

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

2 participants