-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
bugscope:calculationThis issue relates to the calculation logicThis issue relates to the calculation logic
Description
What:
Props returned from useResponsiveProps does not respect common responsive props behaviors.
Why:
The responsive props matcher used on the server accounts only for the default breakpoint. So LgDown prop won't apply (although it should), because "lg" is not the default breakpoint.
const serverMatcher: MatcherFunction = (parsedProp) => {
const { breakpoint } = parsedProp
return breakpoint.isDefault && typeof window === 'undefined'
}Environment:
- atomic-layout version:
0.12.2
Reproduction steps:
import React from 'react'
import { useResponsiveProps } from 'atomic-layout'
// Declaration
const Component = (ownProps) => {
const props = useResponsiveProps(ownProps)
return <div {...props}>Text</div>
}
// Usage
<Component
bgColorLdDown="red"
/>During SSR the background color won't be present at all. It should be red.
Related issues:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugscope:calculationThis issue relates to the calculation logicThis issue relates to the calculation logic