-
-
Save kubilaykiymaci/6f66baa43d9e2c4d7aaec9bc4a89c00a to your computer and use it in GitHub Desktop.
React Flow - PropsType
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GridType = { | |
article: "article", | |
text: "text", | |
test: "test" | |
} | |
type PropsType = { | |
name?: ?string, // ilk ? name prop'unun optional olduğunu | |
// ikinci ? ise name prop'unun string dışında null da olabileceğini gösterir | |
size?: Object | null, // bir diğer null olabilir gösterimi | |
onChange: () => void, // onChange bir fonksiyondur ve zorunlu alandır. Çünkü ? yok | |
currencyList?: Array<string>, // optional bir string array'i | |
grid: $Values<typeof GridType>, // oneOf kullanımı: grid prop'u GridType içerisindeki value'ları alabilir | |
...$Shape<any> // spread notasyonu (...props) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment