How to detect if screen size has changed to mobile in React?

Posted by Jennifer | Updated on

If you want to detect if screen size has changed to mobile in React? What I did is adding an event listener after component mount:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers