title: Send Prop from useEfect
body: <p>App.js -&gt;</p>
  <pre><code>&lt;Lobbies inGame={inGame} setLobby={setLobby} userName={userName} userKey={userKey}/&gt;
  </code></pre>
  <p>Lobbies.js -&gt;</p>
  <pre><code>    import React, { useState, useEffect } from 'react';
  import firebase from 'firebase';
  
  const Lobby = ({userKey, userName}) =&gt; {
  
      useEffect(() =&gt; {
          if (lobbyCreated){
              const db = firebase.database().ref(`Lobby/${lobbyKey}/players`);
  
              const listener = db.on('value', snapshot =&gt; {
                  var fetchedTasks = [];
  
                  fetchedTasks = snapshot.val();
  
                  console.log(fetchedTasks[0]['game']);
  
                  if (fetchedTasks[0]['game']) {
                      //SEND PROP BACK TO APP.JS BELOW
                      props.inGame(true, lobbyKey);
                  }else{
                      if (fetchedTasks.length != players.length)  setPlayers(fetchedTasks);
                  }
              });
  
              return () =&gt; db.off('value', listener);
          }
      });
  };
  </code></pre>
  <p>How can I send a prop back to App.js from Lobbies.js using useEffect? (There is a comment where I want to send the props back) Thank you</p>