Fork me on GitHub
#reagent
<
2019-08-17
>
neupsh17:08:43

is there a way to use react hooks for reagent components? I am trying to use useMediaQuery hook from material ui without any success. If I try to use it in the body of reagent form-2 components (directly in the body and also tried to close the value outside of returning function), but keep getting Invalid hook call. Hooks can only be called inside of the body of a function component. https://material-ui.com/components/use-media-query/#usemediaquery

nenadalm06:08:23

I am using Hidden component if I want to show different components based on screen size: https://material-ui.com/components/hidden/#hidden

David Pham00:08:49

My work around was to create an event listener on the window size, and a re-frame subscription to send me the MUI screen size equivalent