Accepted answer

You can access the inner text via this.props.children and you can pass properties either manually (via this.props) or using ... operator. More of this is described in react.js documentation (note - not React Native docs!). The most relevant parts of the documentation are:

It's general approach of React Native documentation that rather than describing all react concepts, they described only the React Native parts and the actual concept is described in the web/original version of React.


For me I'd just put the children inside the component and call it a day. Also keep in mind sometimes there's different implementations between iOS and Android. Here's something I just wrote and briefly tested

import React, { FunctionComponent } from "react";
import { TouchableNativeFeedback, Platform, TouchableOpacity } from "react-native";

interface IAgnoButton {
    onPress: (item: any) => void,
    style: object

const AgnoButton: FunctionComponent<IAgnoButton> = (props) => {
    return (
        Platform.OS === 'android' ?
                style={{ }}
                { props.children }
            </TouchableNativeFeedback> :
                style={{ }}
                { props.children }
export default AgnoButton;


you can checkout this repo from github:

some code here:

<View style={[styles.tabbarView,, this.state.keyboardUp && styles.hidden]}>
    <TouchableOpacity key={ + "touch"}
        style={[styles.iconView, this.props.iconStyle, ( || el.key) == selected ? this.props.selectedIconStyle || el.props.selectedIconStyle || {} : {} ]}
        onPress={()=>!self.props.locked && self.onSelect(el)}
            {selected == ( || el.key) ? React.cloneElement(el, {selected: true, style: [, this.props.selectedStyle, el.props.selectedStyle]}) : el}
)} is the key to deal with children components.

Related Query

More Query from same tag