DEV Community

dragooncjw
dragooncjw

Posted on

 

How to call a function immediately

I write my request in my parent Component with code below:

useEffect(() => {
  // my request
}, [])
Enter fullscreen mode Exit fullscreen mode

As we all know, useEffect of parent component will implement after child component, so this request will be implemented after all child components rendered.
How can I call my request immediately before my child component's useEffect?

Top comments (0)

👋 Have You Posted on DEV Yet?

Head over to our Welcome Thread and tell us a bit about yourself!