Search code examples
reactjsreact-nativereact-native-elementsreact-native-vector-icons

What do I need tvParallaxProperties for? (react-native-elements Icon)


I wanted to use icons in my react-native app, so I installed react-native-elements. The Icons itself work but I have to add a property called tvParallaxProperties on the Icon element like that:

<Icon tvParallaxProperties={undefined} name={'up'} type="antdesign" />

I read the docs and google about that, but I cant find the use of that. Does anyone know why I need this property and whats the use of it?


Solution

  • If you don't want to write this option under all of the Icons there's 2 solutions. First which I don't recommend if you are creating real project not for training purpose.

    1. Install RN Elements bleeding Edge from docs and the newest BETA version (unstable).
    2. Or which worked for me is change imports of Icons like: import { Icon } from 'react-native-elements' to: import Icon from 'react-native-vector-icons/AntDesign';. The last element of import of course is your Icons package and you can change it fe. to: MaterialCommunityIcons After adding this import you can delete option type: antdesign and this tvParallaxProperties={undefined}

    Like docs says tvParallaxProperties are for (Apple TV only) Object with properties to control Apple TV parallax effects.