import Dialog from "react-native-dialog"; import { createRef, Component } from "react"; class Example extends Component { dynamicButtons() { const buttonFunc = () => console.log('click'); const buttons = [ { label: 'Button 1', action: buttonFunc }, { label: 'Button 2', action: buttonFunc }, ]; return buttons.map(({ label , action }) => ); } singleButton() { return ( null} />); } render() { const ref = createRef(); return ( A nice title A good descr console.log("test")} /> console.log("test")} /> {this.dynamicButtons()} {this.singleButton()} ); } }