is some method to make parent useeffect execute before child?
i’m using nextjs, when i set token to axios in rootlayout with state contains token, like this
configAuth(token) {
this.axios_client.defaults.headers.common['Authorization'] = Bearer ${token}
}
useEffect(() => {
qfWebServerClient.configAuth(loginUserInfo.token)
})
after this i use axios get api who need authorize in use effect, i find that the token not init, is empty
is some method to make parent useeffect execute before child?
New contributor
ltdwonder223 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.