so i want to set the access by firebase function and then pass this access props to tabs component as props ,but tabs component is get the initial state null,firebase auth funtion is resolving after that .
class Admin extends React.Component {
state = {
access: null,
};
componentDidMount() {
this.unListen = firebase.auth().onAuthStateChanged(user => {
if (user) {
this.setState(() => ({ access: true }));
}
});
}
componentWillUnmount() {
this.unListen();
}
render(){
return <Tab access={this.state.access}/>
}
}