Title: 3.4 regression when using Redux nested `combineReducers` · Issue #30685 · microsoft/TypeScript · GitHub
Open Graph Title: 3.4 regression when using Redux nested `combineReducers` · Issue #30685 · microsoft/TypeScript
X Title: 3.4 regression when using Redux nested `combineReducers` · Issue #30685 · microsoft/TypeScript
Description: TypeScript Version: 3.4.1 Search Terms: Code // // Redux types // // import { combineReducers, Reducer } from 'redux'; type Reducer = (state: S) => S; declare function combineReducers
(reducers: { [K in keyof S]: Reducer }): R...
Open Graph Description: TypeScript Version: 3.4.1 Search Terms: Code // // Redux types // // import { combineReducers, Reducer } from 'redux'; type Reducer = (state: S) => S; declare function combineReducers
(reducer...
X Description: TypeScript Version: 3.4.1 Search Terms: Code // // Redux types // // import { combineReducers, Reducer } from 'redux'; type Reducer<S> = (state: S) => S; declare function combineRe...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/30685
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"3.4 regression when using Redux nested `combineReducers`","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.4.1\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\n\r\n**Code**\r\n\r\n```ts\r\n//\r\n// Redux types\r\n//\r\n\r\n// import { combineReducers, Reducer } from 'redux';\r\n\r\ntype Reducer\u003cS> = (state: S) => S;\r\ndeclare function combineReducers\u003cS>(reducers: { [K in keyof S]: Reducer\u003cS[K]> }): Reducer\u003cS>;\r\n\r\n//\r\n// Begin example\r\n//\r\n\r\ntype MyState = { combined: { foo: number } };\r\ndeclare const foo: Reducer\u003cMyState['combined']['foo']>;\r\n\r\n// When `strictFunctionTypes` is disabled…\r\n\r\n{\r\n // Unexpected type error:\r\n // Property 'foo' is missing in type '{}' but required in type '{ foo: number; }'.\r\n const myReducer: Reducer\u003cMyState> = combineReducers({\r\n combined: combineReducers({ foo }),\r\n });\r\n}\r\n\r\n{\r\n // Expected type: Reducer\u003c{ combined: {}; }, AnyAction>\r\n // Actual type: Reducer\u003cMyState, AnyAction>\r\n const myReducer = combineReducers({\r\n combined: combineReducers({ foo }),\r\n });\r\n}\r\n\r\n//\r\n// Workaround:\r\n//\r\n\r\n{\r\n const combined = combineReducers({ foo });\r\n // No type error\r\n const myReducer: Reducer\u003cMyState> = combineReducers({\r\n combined,\r\n });\r\n}\r\n\r\n{\r\n const combined = combineReducers({ foo });\r\n // Correct type inference\r\n const myReducer = combineReducers({\r\n combined,\r\n });\r\n}\r\n```\r\n","author":{"url":"https://github.com/OliverJAsh","@type":"Person","name":"OliverJAsh"},"datePublished":"2019-04-01T10:47:31Z","url":"https://github.com/microsoft/TypeScript/issues/30685"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9457bfa8-9277-6e4a-d89d-5cc4a5185dce |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB42:1EC9BC:9DB53D:CA6219:6B00F250 |
| html-safe-nonce | e8ac5998b8e8a28be1c29a9b50e036e070e72fa2366b9e4d9c596d1dedfea919 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjQyOjFFQzlCQzo5REI1M0Q6Q0E2MjE5OjZCMDBGMjUwIiwidmlzaXRvcl9pZCI6IjMzMDc4NDcxMDQzNjUzOTI0NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4ad1638c64489d6807737d5af0b7c3c25c2f21bd61a99a2c0086fa733417bef2 |
| hovercard-subject-tag | issue:427635821 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/30685/issue_layout |
| twitter:image | https://opengraph.githubassets.com/53fa2445658bf7a283b500fa16655e3243f0b7e879393f750a0b634e2893764c/microsoft/TypeScript/issues/30685 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/53fa2445658bf7a283b500fa16655e3243f0b7e879393f750a0b634e2893764c/microsoft/TypeScript/issues/30685 |
| og:image:alt | TypeScript Version: 3.4.1 Search Terms: Code // // Redux types // // import { combineReducers, Reducer } from 'redux'; type Reducer |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | OliverJAsh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width