React JSS media queries fail to work when passed as an object
- Dominant language
- JavaScript
- Stars
- 7.1k
- Forks
- 386
- PR merge metrics
- No merged PRs in 30d
Description
__Expected behavior:__
I should be able to pass an object of media queries.
Example.
```
const useStyles = createUseStyles({
Button: ({queries }) => ({queries }),
});
// From component
const queries = {
'@media (min-width: 50px)': {
color: 'blue',
},
};
useStyles({queries});
```
Is this a supported use case? Or do media queries need to be hardcoded?
__Describe the bug:__
Media queries fail to work when passed dynamically.
__Codesandbox link:__
https://codesandbox.io/s/fragrant-tree-i4nfw?file=/src/App.js
__Versions (please complete the following information):__
- react-jss: 10.5.0
- react: 17.0.1
- react-dom: 17.0.1
- Browser Safari, Chrome, Firefox:
- OS MacOS 10.15.3:
Contributor guide
Research direction
Start with the Codesandbox reproduction in src/App.js and verify the reported behavior using the supplied react-jss 10.5.0, React 17.0.1, and browser details. Trace how the dynamically passed media-query object is handled; done means the example works as expected or the supported usage is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100