I'm trying to pass a Firebase response object from my index.js file into a component as Props, and I can't quite figure out how to pull it off. This is my database query:
`var allFlies = firebase.database().ref('flies');
allFlies.on('value', function(snapshot){
var myObj = snapshot.val()
})`
Which returns a JSON object (and four smaller objects inside of it that I want to be able to use). I'm trying to pass the info in and access it like so:
`ReactDOM.render(
<Router>
<Switch>
<Route exact path="/" component={Home}></Route>
<Route path="/basics" component={Basics}></Route>
<Route path="/flies" component={ ()=> <Flies flyProps={myObj}/> }></Route>
</Switch>
</Router>, document.getElementById('root'));`
I'm not sure how to "export" myObj due to the scope issue.