import React, { Component } from 'react'
import firebase, { reference, signIn } from '../firebase';
import Message from './Message';

const MessageContainer = ({messages}) => {
  const newMessage = messages.map((message, i, array) => {
    return (
      <div key={messages.firebaseId}>
        <div>
          <p className='time-stamp'>{message.time}</p>
          <p className='user-stamp'>{message.user}</p>
        </div>
        <p className='message-stamp'>
          {array[i].message}
        </p>
      </div>
    )
  })

  return (
    <div>
      {newMessage}
    </div>
  )
}

module.exports = MessageContainer;

@@ -265,17 +265,16 @@
 %7Bmessage
-s
 .firebas
@@ -534,32 +534,33 @@
 eturn (%0A    %3Cdiv
+ 
 %3E%0A      %7BnewMess

Add key to each message to get rid of annoying error message