I would like a React component to be responsive to an external state, in this case the size of the viewport. Do I accomplish this internally to my component or do I do a media query which passes the viewport as a size property to the initial render?
Asked
Active
Viewed 5,032 times
2
-
Have your render logic change based on `window.innerWidth` or `.innerHeight` being less than or greater than some value. – deleted user Aug 30 '15 at 05:16
-
Are these numbers accurate @keizom ? – Kamuela Franco Sep 03 '15 at 20:32
1 Answers
4
Take a look at this project: https://github.com/wearefractal/react-responsive, it seems to be exactly what you need.

Eelke
- 2,267
- 1
- 22
- 26