I have this piece of code that works, but I am getting a linter error that says arrow functions should not be used inside jsx props. I have researched and now understand why, but I am having trouble refactoring it to make it work. What would be the best way to go about this?
const renderButtons = (data, onChange) => {
const id = data.get('id');
const buttons = (
<View style={ styles.buttons }>
<Button onPress={ () => onChange(this, { name: id, value: 'alpha' }) } title='A' />
<Button onPress={ () => onChange(this, { name: id, value: 'beta' }) } title='B' />
</View>
);
return buttons;
};