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.

Badge property 'textStyle' has type ViewStyle instead of TextStyle

See original GitHub issue

Explain what you did (Required)

I used several Badges to work as category tags.

Expected behavior (Required)

I wanted to change the text color using textStyle attribute:

<Badge textStyle={{color: 'white'}} />

Describe the bug (Required)

An error shows because the textStyle type is not TextStyle, but ViewStyle

To Reproduce (Required)

Just use a Badge and try to pass TextStyle attributes in the textStyle property. Screenshots (Required)

Docs:

docs

Package Code:

package

Error Example:

error

Your Environment (Required):

software version
react-native-elements 3.3.2
react-native 0.64.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
joaomrcsmartinscommented, Apr 9, 2021

Yes, of course 😄

0reactions
khushal87commented, Apr 12, 2021

@mpochron will be fixed soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript and React Native: Are the type definitions for RN ...
2 : I can't see how you implement your styles but you can test something like this? import { StyleSheet, TextStyle, ViewStyle }...
Read more >
textStyle property - Badge class - material library - Dart API
The DefaultTextStyle for the badge's label. The text style's color is overwritten by the textColor. This value is only used if label is...
Read more >
[styled-components] No overload matches this call for attrs ...
I got the No overload matches this call error in a similar scenario and have a workaround. What I encountered. I defined a...
Read more >
Text Style Props - React Native
Specifies font weight. The values 'normal' and 'bold' are supported for most fonts. Not all fonts have a variant for each of the...
Read more >
react-native-table-component - npm
Cells in Col and Cols components do not support adaptive height. Please set the magin value in the textStyle property to adjust the...
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