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.

Add typescript typings for Icon names.

See original GitHub issue

Describe the feature

Big fan of this awesome library. This is a small suggestion.

If you give an icon an invalid name, you get an error telling you all of the available icon names:

<Button icon="some-inexistent-name"></Button>

// Invalid prop `name` of value `some-inexistent-name` supplied to `Icon`

Screen Shot 2019-11-14 at 9 19 30 PM

It would be useful if the icon prop had Typescript suggestions with the available names.

Also, in the error message, it would be useful to add a link to a website that has the available icon names.

Motivation

It’s hard to know which icon types are usable while coding. Also, the error message is long, so it slows the logs down a little.

Related Issues

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jayucommented, Nov 29, 2019

@nandorojo Could you please add a comment in this thread regarding the typing icon prop? https://github.com/callstack/react-native-paper/issues/1489 Then we could try to find a solution for that in 4.0

0reactions
github-actions[bot]commented, Apr 12, 2020

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create Custom Types in TypeScript - DigitalOcean
Though the basic types in TypeScript will cover many use cases, creating your own custom ... Add a double colon and then add...
Read more >
React Native - expo/vector-icons typescript type definition for ...
I'm trying to find out the type definitions for the icon name of expo/vector-icons, since I am intending to use it for a...
Read more >
Documentation - Symbols - TypeScript
Built-in symbols are used to represent internal language behaviors. Here is a list of well-known symbols: Symbol.hasInstance. A method that determines if a ......
Read more >
@types/react-native-vector-icons - npm
TypeScript definitions for react-native-vector-icons. Latest version: 6.4.12, last published: 4 months ago.
Read more >
Using 'Pick' in TypeScript to simplify Types and Interfaces
@Injectable({ providedIn: 'root', }) export class AuthService { constructor() {} async create({ name, email, password }: any) {...} async login ...
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