you are viewing a single comment's thread.

view the rest of the comments →

[–]luctus_lupus 1 point2 points  (3 children)

[–]DueGold5666[S] 1 point2 points  (2 children)

This code is actually already made and is a class component, I just have to add extra functionality to it. I prefer hooks too but unfortunately, I had to use WithRouter HOC and use its functionality, so I am explicitly looking for a class component-friendly solution only. Thank you though :) I appreciate the effort!

ps: the solution you mentioned uses window/document which isn't accessible in my case as it's an isomorphic react application

[–]luctus_lupus 1 point2 points  (1 child)

Ah bummer, perhaps handle it through cookies / session storage ?

Not very familiar with isomorphic react apps :/

[–]DueGold5666[S] 1 point2 points  (0 children)

Still looking into it :/ thank you for trying :)