How to override React Native Component?

Tags: , ,

Dear Friend I am trying to override a method in react native component, please let me know how I can achieve that.

// BaseButton.js
import React, { Component } from 'react'
import { View, Button } from 'react-native'

export default class BaseButton extends Component {

    onPress = () => {
    render() {
        return (
                    title="Press me"
                    onPress={() => this.onPress()}
// HomeScreen.js
import React, { Component } from 'react'
import BaseButton from './Components/BaseButton'

BaseButton.prototype.onPress = () => {

export default class HomeScreen extends Component {
            <BaseButton />


There is no such a thing as component override as I know. But if you want to customize the component then you can wrap with with another component and you can use props for access the default features of the the component and for additional features you can create your own state and props inside your wrapper component.

please refer following link for know about react native props,

Source: stackoverflow