example with Typescript?
See original GitHub issueThanks for this Library, I’m using it in 3 different project 😉 works quite well.
I decided to start with typescript for my new project, but I’ve no idea how to use it with this Library … :<
Here is an example with ScaledSheet :
const styles = ScaledSheet.create({
iconButtonFab: { color: colors.white, fontSize: "22@ms" },
});
What type should be styles ? Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Documentation - TypeScript for JavaScript Programmers
TypeScript knows the JavaScript language and will generate types for you in many cases. For example in creating a variable and assigning it...
Read more >Typescript example: Beginners Guide To ... - AppDividend
Typescript is a typed superset of Javascript that compiles to plain JavaScript. TypeScript is open source language maintained by Microsoft.
Read more >TypeScript Tutorial: What is, Interface, Enum, Array with Example
Syntax: var firstname = "Roy";. Let us take a look at few TypeScript examples to understand the working of var keyword and also...
Read more >TypeScript Tutorial - Tutorialspoint
TypeScript is pure object oriented with classes, interfaces and statically typed like C# or Java. The popular JavaScript framework Angular 2.0 is written...
Read more >TypeScript Tutorial - W3Schools
TypeScript is JavaScript with added syntax for types. Start learning TypeScript now ». Examples in Each Chapter. Our "Try it Yourself" editor makes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey thanks,
I went through all my components and everything works 😉 (wow it’s nice to see all green ^^).
Hey @readthaiapp, glad you enjoy the lib! The type returned is the same type returned from react-native
StyleSheet.create
. You can check it out on the index.d.ts file.But since the type is already declared there I wouldn’t bother stating it again on the
styles
declaration, it’s already inferred from the index.d.ts file.