Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Last active September 29, 2019 03:15
Show Gist options
  • Save bookercodes/277286c53b20c1dc5fd241934c6c9894 to your computer and use it in GitHub Desktop.
Save bookercodes/277286c53b20c1dc5fd241934c6c9894 to your computer and use it in GitHub Desktop.
<MessageList messages={state.messages} renderMessage={message => <Message {...message } /> } />

renderMessage is an optional parameter.

The default behaviour for renderMessage is illustraed above. If you would like to render your own message, you can define a custom function. Make sure to return a div with .div { display: block } so that automatic scrolling to the bottom works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment