-
Notifications
You must be signed in to change notification settings - Fork 86
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
Translate class import issue with TypeScript #68
Comments
@gnyekhelyi what version of react-localize-redux you using? Also are you using Typescript, and if so which version? |
I'm using react-localize-redux 2.17.3 and typescript 2.7.2. |
K problem is the fix I made to make in // current index.d.ts has this...
export default class Translate extends ReactComponent<TranslateProps> {}
// should be this...
export class Translate extends ReactComponent<TranslateProps> {}
@gnyekhelyi I was able to publish the fix with the proper export in |
Ok, thank you! |
@gnyekhelyi let me know if you have any interest in helping with #69. |
Thanks for the quick response. I am using your lib in a new project with TypeScript and would like to see it keep working. I might be able to lend a hand with typings, if nothing else at then at least two smoke test new typings. I am pretty new to Typescript though. |
@RikuVan any help would be appreciated! Also did that latest release |
yep I had the same issue. Seems ok, although I am still refactoring now to update with the new api. |
Closing this issue based on RikuVan’s feedback. |
import { Translate } from 'react-localize-redux';
Throws:
Module '".../node_modules/react-localize-redux/lib/index"' has no exported member 'Translate'.
import Translate from 'react-localize-redux';
Throws:
"export 'default' (imported as 'Translate') was not found in 'react-localize-redux'
import * as Translate from 'react-localize-redux';
Throws:
JSX element type 'Translate' does not have any construct or call signatures.
Modifying
export default class Translate extends ReactComponent<TranslateProps> {}
to
export class Translate extends ReactComponent<TranslateProps> {}
in index.ts.d fixes the issue for me, I can use the following syntax to import Translate without any errors:
import { Translate } from 'react-localize-redux';
The text was updated successfully, but these errors were encountered: