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
Using Map with Typescript #1706
Comments
Facing same problem. Created this csb for reference https://codesandbox.io/s/immutable-map-typescript-issue-56t35 |
We can resolve the typescript error with the below steps.
|
Thank you for your bug report. The immutable-js oss fork will soon be merged and a fix for this issue has been included in #1833. Once this PR is merged, this issue will be resolved in the main branch. We will then do our best to to release the |
Hi! |
faced same error even though tried use 4.0.0-rc.14 |
@ClusterH can you try with the stable 4.0.0 and post a reproducible code snippet if there is the error is still present? |
Hello, i found an interesting issue. When i am passing an object in Map it works fine:
But when i am trying to pass an array like on screen below, compiler complains:
I took a that variant from here: https://immutable-js.github.io/immutable-js/docs/#/Map/Map
Argument of type 'string[][]' is not assignable to parameter of type '{ [key: string]: {}; }'. Index signature is missing in type 'string[][]'
In my opinion, it works that way because we have an overloaded Map functions at definitions file, and typescript choosing second variant instead of first.
ts version: 3.3.333333
The text was updated successfully, but these errors were encountered: