Update react component state on every route change in Docusaurus

Amrish Kushwaha
3 min readJun 16, 2021

Let’s say you are building a documentation website using Docusaurus. There is some requirement that needs you to update the state or trigger to change the state of a react component that resides on every page of docs.

Quite a simple problem, huh!

We will try to find a solution in this article.

Pics which contains code
A picture that contains code

--

--

Amrish Kushwaha

Engineer & Writer | Writes about Tech, Productivity, Building Product and Success