question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

example with Typescript?

See original GitHub issue

Thanks 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:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
readthaiappcommented, Oct 3, 2018

Hey thanks,

I went through all my components and everything works 😉 (wow it’s nice to see all green ^^).

1reaction
nirskycommented, Oct 3, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found