redux-responsive icon indicating copy to clipboard operation
redux-responsive copied to clipboard

How to properly handle non-numerical media queries

Open AlecAivazis opened this issue 9 years ago • 1 comments

Our current implementation gives browser.lessThan.landscape a false value which is not quite right. Maybe this is a good usecase for setting the value to undefined?

AlecAivazis avatar Oct 29 '15 23:10 AlecAivazis

For the project I'm currently working on, we've leaned heavily on leaving items undefined where possible (though Redux gets in the way of that somewhat) because (a) we're using react-redux and supplying everything as destructured props, and (b) we're using Typescript/ES6, so it's extremely easy to have inline defaults inside a component for undefined items from the Redux state (but not for null ones).

However, the "official" approach for Redux seems to be to set things null and never use undefined, to the point of it refusing to accept undefined values from normal reducers.

icopp avatar Nov 03 '17 04:11 icopp