Linear Gradient for background styling in Native app

I want to style native app with linear gradient background colors. How can we create a custom class (using react style props in JavaScript) which can be used to apply linear gradient as background color to any container in a native app? For simple plain colors, we can use backgroundColor property from ColorStyle, but couldn’t find any for a gradient. Also no information available regarding gradient in native styling cheat sheet.  Anyone having some information on how to use external libraries of react native like to create our own JS style classes which can be applied in Mendix to any container widget?
1 answers

Hi Umar,

To use a library like react-native-linear-gradient, you would need to create a pluggable widget. This would be your best option at this moment. React Native doesn’t have any way to create gradients of its own. It is not yet at the same level as CSS on the web.