styled-components v2.0.0 Release Notes

Release Date: 2017-05-25 // almost 7 years ago
    • 💅 Update css-to-react-native - you'll now need to add units to your React Native styles (see css-to-react-native, code mod)
    • 💅 Update stylis to latest version (see #496).
    • ➕ Added per-component class names (see #227).
    • ➕ Added the ability to override one component's styles from another.
    • Injecting an empty class for each instance of a component in development.
    • ➕ Added attrs constructor for passing extra attributes/properties to the underlying element.
    • ➕ Added warnings for components generating a lot of classes, thanks to @vdanchenkov. (see #268)
    • 💅 Standardised styled(Comp) to work the same in all cases, rather than a special extension case where Comp is another Styled Component. Comp.extend now covers that case. (see #518).
    • ➕ Added Comp.withComponent(Other) to allow cloning of an existing SC with a new tag. (see #814.
    • ➕ Added a separate no-parser entrypoint for preprocessed CSS, which doesn't depend on stylis. The preprocessing is part of our babel plugin. (see babel-plugin-styled-components/#26)
    • 🛠 Fix defaultProps used instead of ThemeProvider on first render @k15a, restored.
    • 🐎 Refactor StyledComponent for performance optimization.
    • 💅 Prevent leakage of the innerRef prop to wrapped child; under the hood it is converted into a normal React ref. (see #592)
    • 💅 Pass innerRef through to wrapped Styled Components, so that it refers to the actual DOM node. (see #629)
    • ➕ Added a dedicated Server-Side-Rendering API, with optimised rehydration on the client. Keys are now sequential.
    • ➕ Add hoisting static (non-React) properties for withTheme HOC, thanks to @brunolemos. (See #712)
    • ➕ Add innerRef support to withTheme HOC. (see #710)
    • 💅 Switch to babel-preset-env. (see #717)
    • 💅 Update StyledNativeComponent to match StyledComponent implementation.
    • 🛠 Fix Theme context for StyledComponent for IE <10. (see #807)
    • 💅 Restore setNativeProps in StyledNativeComponent, thanks to @MatthieuLemoine. (see #764)
    • 🛠 Fix ref being passed to Stateless Functional Components in StyledNativeComponent. (see #828)
    • ➕ Add displayName to componentId when both are present (see #821)
    • 💅 Test node 8.x as well in travis (see #1153)