Releases: kettanaito/atomic-layout
Releases · kettanaito/atomic-layout
[email protected]
[email protected]
[email protected]
Breaking changes
useResponsiveComponent()
function has been renamed tomakeResponsive()
in order to prevent a confusion over that function being a React hook (which it's not).
- import { withResponsiveComponent } from 'atomic-layout'
+ import { makeResponsive } from 'atomic-layout'
const Image = styled.img``
- export default withResponsiveComponent(Image)
+ export default makeResponsive(Image)
<Image src="small.png" srcMd="large.png" />
Features
- Adds a new
query()
utility function for shorthand composition of inline media queries aligned with your Layout options:
import styled from 'styled-components'
import { query } from 'atomic-layout'
const Component = styled.div`
@media ${query({ from: 'md' })} {
background-color: red;
}
`
[email protected]
Changes
- Removes the
<MediaQuery/>
component (#309, #313). Please replace its usage in your code with theuseMediaQuery
hook:
- import { MediaQuery } from 'atomic-layout'
+ import { useMediaQuery } from 'atomic-layout'
const Usage = () => {
+ const matches = useMediaQuery({ minWidth: '500px' })
return (
- <MediaQuery minWidth="500px">
- {matches => matches && <p>Conditional content</p>}
- </MediaQuery>
+ {matches && <p>Conditional content</p>}
)
}
Bug fixes
- Fixes an issue that resulted into the library's README being broken on NPM (#277)
[email protected]
This is published as a minor release, since in case you have a wrongly typed responsive props (i.e.
templatelg
) they worked in the previous release, but will stop doing so in this one.
Bug fixes
[email protected]
[email protected]
Bug fixes
- Exported components now come with a meaningful
displayName
property for easier debugging in React DevTools (#306)
0.13.0
0.12.7
0.12.0
This release does not introduce new features, but changes the way Atomic Layout functions internally. It's recommended to update to
0.12.0
to test the changes and be ready for the upcoming features.
Internal
- Restructures Atomic Layout to be a monorepo
- A monorepo includes
@atomic-layout/core
library and a single rendering implementationatomic-layout
(styled-components) for backward-compatibility