iyegoroff / react-native-text-gradient

Text gradient for React-Native (ON HIATUS)
MIT License
97 stars 32 forks source link

element type is invalid #21

Closed bitpaydotir closed 6 years ago

bitpaydotir commented 6 years ago

i get this error: Element type is invalid: expected a string or a class/function(for composite components) but got: object

I changed the import, but did not work: import LinearTextGradient from 'react-native-text-gradient';

please help

iyegoroff commented 6 years ago

https://github.com/iyegoroff/react-native-text-gradient#example

bitpaydotir commented 6 years ago

I used the following code: import { LinearTextGradient } from 'react-native-text-gradient';

<LinearTextGradient style={{ fontWeight: 'bold', fontSize: 72 }} locations={[0, 1]} colors={['red', 'blue']} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}

THIS IS TEXT GRADIENT The problem did not resolve

iyegoroff commented 6 years ago

Looks like you forgot the closing tag.

bitpaydotir commented 6 years ago

I forgot to use the tag code in the github:

mycode:

<LinearTextGradient
  style={{ fontWeight: 'bold', fontSize: 72 }}
  locations={[0, 1]}
  colors={['red', 'blue']}
  start={{ x: 0, y: 0 }}
  end={{ x: 1, y: 0 }}
>
  THIS IS TEXT GRADIENT
</LinearTextGradient>

rn version: 0.54

iyegoroff commented 6 years ago

And what is your rntg version? Should be 0.0.7 - https://github.com/iyegoroff/react-native-text-gradient#status

bitpaydotir commented 6 years ago

Thanks, it's worked Because it was written with rn> = 0.54.0 use 0.0.7 i used the latest version