Invariant Violation: Text strings must be rendered within a component

前端 未结 24 841
耶瑟儿~
耶瑟儿~ 2020-12-08 12:59

I\'ve upgraded from RN 0.54 to 0.57 and my app has pretty much fallen over due to using React Native Elements.

I took use of their error functionality on TextI

24条回答
  •  抹茶落季
    2020-12-08 13:29

    This occurred for me because I was using a lower-case function name by accident:

    export const p = (props) => {
      return (
        {props.children}
      );
    };
    

    Should be:

    export const P = (props) => {
      return (
        {props.children}
      );
    };
    

    Notice in the second one the p is capitalized. This is needed in order for the components to be detected as React Native components.

提交回复
热议问题