I'm trying to make a custom menu to share pictures and location using the renderAction prop in gifted-chat. I can't get it to call a function. renderActions={console.log('hello')} outputs as expected, for some reason functions aren't being called.
I've looked at code examples, and I can't find anything that I'm missing - but obviously I'm missing something.
here's the code. If there's any extra info that would be helpful, please let me know and I'll add it. Still new to stack.
renderActions > console.log() doesn't get called
renderActions() {
console.log('renderActions called');
}
renderAction={console.log()} get's called. renderActions={this.renderActions} does not get called. I've tried passing it in every way I can think of: {() = > this.renderActions()}, {this.renderActions.bind(this)}, {this.renderActions} ... nothing seems to work.
render() {
let bgColor = this.props.route.params.bgColor;
return (
<View style={[styles.bodyContent]}>
<GiftedChat
renderBubble={this.renderBubble.bind(this)}
renderSystemMessage={this.renderSystemMessage.bind(this)}
renderInputToolbar={this.renderInputToolbar.bind(this)}
renderActions={() => this.renderActions()}
messages={this.state.messages}
onSend={(messages) => this.addMessage(messages)}
user={{
_id: this.state.uid,
}}
/>
{Platform.OS === 'android' ? (
<KeyboardAvoidingView behavior="height" />
) : null}
</View>
);
}
Any help would be greatly appreciated. I'm sure I'm missing something obvious, but I'm completely stumped. Thank you!