'How to add/disable features on NextJS site based on region?

I want to disable components from rendering if a user is in a specific region.

I am assuming the best way to do this is by using internationalized routing with domain routing and then only rendering the component if it is in a permitted domain. Is this the most efficient way to do this? If so, how would you get the locale, in a useEffect?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source