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.47k stars 2.13k 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 4 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 2 years 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 7 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

aurangs7 commented 2 months ago

In Android I am getting:

Error while updating property 'fontWeight in shadow node of type: AndroidTextinput java.lang.Double cannot be cast to java.lang.String

Anything for this?

GalMarkelj commented 1 month ago

In Android I am getting:

Error while updating property 'fontWeight in shadow node of type: AndroidTextinput java.lang.Double cannot be cast to java.lang.String

Anything for this?

Same problem for me

vipulbhj commented 1 month ago

In Android I am getting: Error while updating property 'fontWeight in shadow node of type: AndroidTextinput java.lang.Double cannot be cast to java.lang.String Anything for this?

Same problem for me

Same for me

GalMarkelj commented 1 month ago

I have found the issue. The issue was that I had fontWeight styling on a TextInput from react-native. When removing it, the issue was resolved.

I saw that in typescript definition of the TextInput component it says that style attribute is style?: StyleProp<TextStyle> | undefined, so I don't know why fontWeight is the issue here.

If someone has the answer why fontWeight on TextInput is giving us a hard time, let us know please.

I know that the main title of this issue if regarding 'fontSize', so I'm guessing that somewhere in your code is fontSize assigned to something that it shouldn't be.