Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
React Native Text style is not working (Icon Badge)

I tried to make a badge icon with red text, but all the styles I applied to the Text didn't work at all

IconWithBade.js

import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
import MatComIcon from 'react-native-vector-icons/MaterialCommunityIcons';
export const IconWithBadge = props => {
  const {text, iconName} = props;
  return (
    <View>
      <MatComIcon name={iconName ?? 'cart-variant'} size={22} color="grey" />
      {text && (
        <View style={styles.badgeStyle}>
          <Text styles={styles.BadgeTxt}>12</Text>
        </View>
      )}
    </View>
  );
};
const styles = StyleSheet.create({
  badgeStyle: {
    position: 'absolute',
    right: -5,
    top: -5,
  },
  BadgeTxt: {color: 'red', fontWeight: 'bold'},
});

This my Header.js

everything on text style is not working

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need remove charater s after styles

<Text style={styles.BadgeTxt}>12</Text>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!