I want my page transition to happen conditionally based on screen size. I don't want the animation to happen on small screens. This is what I've written:
const mq = window.matchMedia( "(min-width: 600px)" )
const transitions = useTransition(location, location => location.pathname, {
from: {{mq ? transform: "translateX(100%)" : transform: "translateX(0)"}, position:'absolute', width: '100vw', opacity: 0},
enter: {opacity: 1, width: '100vw', transform: "translateX(0)"},
leave: {opacity: 0, transform: "translateX(-50%)"}
})
I've tried different variations of this but it doesn't work.