Due to the great interest in previous Cheat Sheets and requests for another. Here you are, new cheat sheet, this time for React (finally!). Compressed overview for fundamental functionalities. Red Hat Developer cheat sheets 🌟 Browse through our collection of cheat sheets to help you develop with Red Hat products, which you can download for free as a Red Hat Developer member. You’ll find handy guides on a range of the latest developer tools and technologies, including Kubernetes, microservices, containers, and more. Spread the love Related Posts JavaScript Best Practices — Modern SyntaxThere are better ways to write JavaScript code than others. In this article, we’ll look JavaScript Best Practices — Basic SyntaxLike any kind of app, JavaScript apps also have to be written well. Otherwise, we JavaScript Best Practices — No Useless SyntaxTo make code easy to read and maintain, we should. Npm install -g expo-cli expo init AwesomeProject //choose a typescript template cd AwesomeProject expo start // If you want to use the bare workflow run expo eject b/ using React Native CLI. If you need to link specific native libraries not supported by expo you can start with React Native CLI or eject Expo.
← Go BackIntroduction
A note to self lest I forget the resources I learned from.
As I was going thru Swyx's React TypeScript Cheatsheet, Props: Omit prop from a type, I had trouble understand the definition of Omit
.
Could not wrap my heads around it so Googled and found Marius Schulz's blog posts.
Blog read order
I read these backwards initially but the posts in following order seems to make sense.
- keyof and Lookup Types in TypeScript - Learn about
keyof
used forOmit
andExclude
- Conditional Types in TypeScript - To understand
Exclude
- The Omit Helper Type in TypeScript - To finally learn how
Omit
is implemented
References
Advaned utlity type document and sources for Peanut obsidian.
Omit<Type, Keys>
- Definition: Constructs a type by picking all properties from Type and then removing Keys.
- Documentation: https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys
- Source: https://github.com/microsoft/TypeScript/blob/master/lib/lib.es5.d.ts#L1504
Pick<Type, Keys>
- Definition: Constructs a type by picking the set of properties Keys from Type.
- Documentation: https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys
- Source: https://github.com/microsoft/TypeScript/blob/master/lib/lib.es5.d.ts#L1480
Exclude<Type, ExcludedUnion>
- Definition: Constructs a type by excluding from Type all union members that are assignable to ExcludedUnion.
- Documentation: https://www.typescriptlang.org/docs/handbook/utility-types.html#excludetype-excludedunion
- Source: https://github.com/microsoft/TypeScript/blob/master/lib/lib.es5.d.ts#L1494
Typescript Cheat Sheet 2020 Printable
Misc. Link
Need to watch Marius Schulz's Egghead course, Advanced Static Types in TypeScript.
Typescript React Cheat Sheet
Image by Edward Lich from Pixabay
cuz, Donut's hole reminds me of Omit 😉
Webmentions
Loading counts..