-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Playground Examples #25
Comments
Also TSX. |
Add an example showing where type annotations do matter: When declaring variables of object literals.
When deleting a property from Add an example demonstrating why casts are often a bad idea and undermine type safety:
|
One about proper usage of built-in helpers like |
It's a little bit verbose, but I think the example React component in TypeScript-React-Native-Starter covers a lot of the value in using TypeScript with React |
I suggest looking this playground from @agentcooper which has some additional examples but also has even more features than the official playground. Also, I'll link this related issue: agentcooper/typescript-play#4 |
|
‘ts-check’ example as well. |
Blast from the past on this issue - but I've moved it to the TS website now, I've tried to think of the examples from quite far back - helping folks look for simpler JS use cases (if you're new) all the way to advanced TS things like conditional types. What do folks think of this general progression? ( To do it I'd have to add JS support, and type acquisition to the playground - but that's achievable ) |
There isn't done for showing how to work with the DOM! Added |
OK... well, on 2nd round when trying to think about the advanced types much harder. I ended up coming up with "a lot" but also TS things which weren't quite "advanced" - so: then for things which are really typescript and not just day-to-day JS ... ideally there'd be one more. Maybe that could be example apps or something which when you run it would be cool, sorta like the current retracer |
This is shipped! |
The TypeScript Playground examples are... not great. We deserve a new set.
General principles
Please Suggest More!
Basic Types & Inference
Functions
Union Types
Generics
ES6 Classes
What else?
The text was updated successfully, but these errors were encountered: