oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.36k stars 2.12k forks source link

Error while updating property 'fontSize' in shadow node of type: RCTText #1200

Open CodingXD opened 4 years ago

CodingXD commented 4 years ago

Environment

OS: Android 6.0.1 (real device, not emulator) react-native-vector-icons: ^7.0.0 react: 16.11.0, react-native: 0.62.2,

Description

The issue is rather simple. Whenever I use react-native-vector-icons, get the error, Error while updating property 'fontSize' in shadow node of type: RCTText Screenshot_20200709-153842

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

import React from 'react';
import {View, TouchableOpacity, Text, StyleSheet} from 'react-native';
import Ionicons from 'react-native-vector-icons/Ionicons';

const Header = () => {
  return (
    <View style={styles.viewStyle}>
      <TouchableOpacity onPress={() => alert('Menu')}>
        <Ionicons name="md-apps" size={20} />
      </TouchableOpacity>
      <Text style={styles.textStyle}>ALL PRODUCTS</Text>
      <TouchableOpacity onPress={() => alert('Shopping Cart')}>
        <Text>C</Text>
      </TouchableOpacity>
    </View>
  );
};

const styles = StyleSheet.create({
  viewStyle: {
    flexDirection: 'row',
    backgroundColor: '#f8f8f8',
    justifyContent: 'space-between',
    alignItems: 'center',
    height: 60,
  },
  textStyle: {
    fontSize: 12,
    fontWeight: 'bold',
  },
  cartStyle: {
    marginHorizontal: 15,
  },
});

export default Header;
aqeebimtiaz commented 3 years ago

Any update on this? I'm getting this type of error on 0.61.2.

haloriyan commented 2 years ago

Stil waiting for solution on RN 0.64.3 and RNVectorIcon 9.0.0

octoro-software commented 2 years ago

@haloriyan @aqeebimtiaz passing style={{fontSize: 30}} will bypass this error

ChillyHoney commented 2 years ago

@haloriyan @aqeebimtiaz passing style={{fontSize: 30}} will bypass this error

Works for me, thanks

EinsteinNjoroge commented 1 year ago

Expanding on @octoro-software's suggestion, I solved this by checking for instances where fontSize was defined as a string and changed that to an integer. style={{ fontSize: '13' }} => style={{ fontSize: 13 }}

Alphonse-K commented 1 year ago

This really help after 1 day of struggle

OleksiiKonovalchuk commented 1 year ago

error while updating property fontWeight in shadow node of type rcttext in react-native and there are no strings in the code for fontWeight

deepnothing commented 1 year ago

try this - any icon size you are passing in as size={'10'} or size={10} should be passed as style={{ fontSize:10 }}

LuisBuenanio commented 4 months ago

error al actualizar la propiedad fontWeight en el nodo oculto de tipo rcttext en reaccionar-nativo y no hay cadenas en el código para fontWeight

Logró solucionarlo? tengo mismo error