In Unistyles 2.0, developers could retrieve the breakpoint value from the useStyles hook.
This was helpful for hiding certain JSX components based on specific screen sizes.
However, this pattern was a bit tedious, as it required writing custom logic to determine whether a component should be visible or not.
With Unistyles 3.0, we’ve removed the useStyles hook, so there is no direct way to listen for breakpoint changes.
But don’t worry — it’s still possible to hide or show components!
Display
The Display component helps you show its children based on breakpoints or media queries.
You can also use pixel-based values:
Hide
On the opposite side, the Hide component helps you hide its children based on breakpoints or media queries.
It works exactly the same way as the Display component.