Answers for "react change button color"


react change button color

The react Button component renders the native button on each platform it uses. Because of this, it does not respond to the style prop. It has its own set of props.

The correct way to use it would have been

<Button color="#ff5c5c" title="I'm a button!" />

You can see the documentation at

Now, say you do want to make super customizable button, for that you'll have to use views and touchable opacity. Something along the lines of this.

<TouchableOpacity onPress={...}>
  {... button markup}
You'll wrap that up in your own button component and use it.
Posted by: Guest on March-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language