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
Hey I found this typo on docs under GetStarted/Installation/using Typescript page under the "useReducer" section, the code includes ";" but it should be ","
Hey I found this typo on docs under GetStarted/Installation/using Typescript page under the "useReducer" section, the code includes ";" but it should be ","
The code is written as follows
type CounterAction =
| { type: "reset" }
| { type: "setCount"; value: State["count"] }
With ";" in object it should be a "," after the type:"setCount"
The updated code should look like this
type CounterAction =
| { type: "reset" }
| { type: "setCount", value: State["count"] }
Thanks.
The text was updated successfully, but these errors were encountered:
The line you're referring to is not an object, it is an object type. In TypeScript, ;or, can be used in object types, and many codebases opt to use a semicolon to help differentiate the object type from an actual object.
Summary
Hey I found this typo on docs under GetStarted/Installation/using Typescript page under the "useReducer" section, the code includes ";" but it should be ","
Page
https://react.dev/learn/typescript
Details
Hey I found this typo on docs under GetStarted/Installation/using Typescript page under the "useReducer" section, the code includes ";" but it should be ","
The code is written as follows
type CounterAction =
| { type: "reset" }
| { type: "setCount"; value: State["count"] }
With ";" in object it should be a "," after the type:"setCount"
The updated code should look like this
type CounterAction =
| { type: "reset" }
| { type: "setCount", value: State["count"] }
Thanks.
The text was updated successfully, but these errors were encountered: