How to use a gradient in Native Base's Box in ReactJS?

Viewed 200

I'm trying to use Native Base in a browser ReactJS application (not a React Native one), and I'm struggling to use gradient background for Box in this case.

The documentation only explains how to do it on React Native environment (Expo or vanilla React Native), but nothing about ReactJS applications.

It seems not possible to "inject" some class names to divs at some point with Native Base, so not possible to create the gradient in pure CSS aside of Native Base.

Do you have any ideas?

Thanks!

1 Answers

It looks like you may be able to use the "With Ref" example at the bottom of the documentation to get a gradient.

I was able to use arbitrary CSS in the "styleObj" example, and was able to create a gradient:

screenshot of Native Base playground demonstrating gradient background

Related