Pick
and conditional update in React.setState
#13359
Labels
External
Relates to another program, environment, or user action which we cannot control.
TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20170108 )
Code
Pick
is supposed to work for typing React.setState (#12793).However, there is a problem if you want to conditionally change which attributes to update.
Expected behavior:
The code compiles successfully.
Actual behavior:
component.setState
line in the above code emits an error.You have to write like this to avoid the error.
The text was updated successfully, but these errors were encountered: