<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.