Param Singh
Feb 24, 2017 · 1 min read

Well, yeah. That’s possible. You can use the route enter hook of a react-router’s route and then trigger a loader in your root component (say App.jsx) and then in the componentDidMount, turn it off by dispatching a redux action (if you’re using redux) or event emitter otherwise. Only condition is it’s a child component of something (like App in our case).

    Param Singh

    Written by

    UI Engineer at Swiggy, Ex-Flipkart. JS enthusiast. Cynophilist. GrammerNazi. Environmentalist

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade