You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React's setState(state) method accepts an object with only some of the total set of keys found in a component's state but to express that in Typescript the definition of the interface passed to React.Component[Props, State] has to be somewhat sacrificed by making all fields optional (?):
mhegazy
added
Duplicate
An existing issue was already created
and removed
Needs Proposal
This issue needs a plan that clarifies the finer details of how it could be implemented.
labels
Oct 26, 2015
React's setState(state) method accepts an object with only some of the total set of keys found in a component's state but to express that in Typescript the definition of the interface passed to React.Component[Props, State] has to be somewhat sacrificed by making all fields optional (?):
Better IMO would be to have some way of specifying that the argument to setState is a 'fragment' of State.
The text was updated successfully, but these errors were encountered: