Skip to content

Docs does not specify how to make Linear Gradient button to work #4012

@BaccanoMob

Description

@BaccanoMob

Is there an existing issue for this?

  • I have searched the existing issues

Explain what you did

I tried to create the Linear Gradient button from https://reactnativeelements.com/docs/components/button 's examples.

The author of the docs remembered to put the comment // Don't forget this!

Image

But failed to remember in the example below it,

Image

You will notice that CustomTitle button is missing ViewComponent={LinearGradient} so the docs technically not showing a working example. I got no clue where to get LinearGradient so I can check the imports.

I tried importing from import LinearGradient from 'react-native-linear-gradient'; but I get

  • Render error: View config not found for component 'BVLinearGradient' on my expo go and
  • Uncaught Error (0 , _reactNativeWebDistIndex.requireNativeComponent) is not a function react native web.

Turns out I needed to install expo-linear-gradient since I was using expo (? not sure if it works as intended outside expo)

Expected behavior

To get Linear Gradient button working like in the docs

Describe the bug

It would nice if there is note or any callout card stating where to get the LinearGradient like below

Image

Instead of being hidden in the show code block.

Image

Steps To Reproduce

.

Screenshots

No response

Your Environment

No response

Metadata

Metadata

Assignees

Type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions