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
(property) ExampleComponent.state: {
ans: string;
}
Property 'state' in type 'ExampleComponent' is not assignable to the same property in base type 'Component<PropsType, StateType, any>'.
Type '{ ans: string; }' is not assignable to type 'Readonly<StateType>'.
Types of property 'ans' are incompatible.
Type 'string' is not assignable to type '"yes" | "no"'.(2416)
The text was updated successfully, but these errors were encountered:
Search Terms:
enums react, unions broken, react union broken, react state union
Code
Playground Link
Expected behavior:
no errors
Actual behavior:
error on
state = { ans: 'yes' };
The text was updated successfully, but these errors were encountered: