Closed developeruzairsaleem closed 7 months ago
Hey there, @developeruzairsaleem! 👋
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.
Thanks By the way.
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.