Changelog History
Page 6
-
v4.0.0-beta.1 Changes
September 06, 2018๐ Fixed an issue where
createGlobalStyle
was clobbering the very next style to be applied during rehydration in production mode, by @probablyup (see #1976)โ Removed some unused code, by @probablyup (see #1976)
๐ Switched
createGlobalStyle
to be aPureComponent
, by @probablyup (see #1976)
-
v4.0.0-beta.0 Changes
September 04, 2018โ Remove deprecated
consolidateStreamedStyles
API, by @probablyup (see #1906)โ Remove deprecated
jsnext:main
entry point from package.json, by @probablyup (see #1907)โ Remove deprecated
.extend
API, by @probablyup (see #1908)๐ Migrate to new context API, by @alexandernanberg (see #1894)
โ Remove TS typings; they are now to be found in DefinitelyTyped, by @probablyup. See https://github.com/styled-components/styled-components/issues/1778 for more information.
โ Add new
data-styled-version
attribute to generated<style>
tags to allow multiple versions of styled-components to function on the page at once without clobbering each other, by @probablyup
It's still highly recommended to use aliasing via your bundler to dedupe libraries like styled-components and react.
Keyframes is now implemented in a "lazy" manner: its styles will be injected with the render phase of components using them.
keyframes
no longer returns an animation name, instead it returns an object which has method.getName()
for the purpose of getting the animation name.- โ Add
createGlobalStyle
that returns a component which, when mounting, will apply global styles. This is a replacement for theinjectGlobal
API. It can be updated, replaced, removed, etc like any normal component and the global scope will update accordingly, by @JamieDixon @marionebl, @yjimk, and @imbhargav5 (see #1416)
const GlobalStyles = createGlobalStyle` html { color: 'red'; } `; // then put it in your React tree somewhere: // <GlobalStyles />
๐ Migrate to use new
React.forwardRef
API, by @probablyup; note that this removes theinnerRef
API since it is no longer needed.๐ Implement
styled()
wrapper folding. In a nutshell, when you nest styled wrappers (e.g.styled(styled.div)
) the components are now folded such that only one is mounted that contains the merged styles of its ancestors. This is conceptually equivalent to the removed "extend" functionality, but without many of the downsides -- and it's automatic, by @probablyup (see #1962)โ Added a first-class API for rendering polymorphism via "as" prop. In most cases, this new prop will replace your need to use the
.withComponent
API. It allows you to control what underlying element or component is rendered at runtime, while not messing with the styles, by @probablyup (see #1962)
import { Link } from 'react-router' const Component = styled.div` color: red; ` // Examples <Component>Hello world!</Component> <Component as="span">Hello world!</Component> <Component as={Link} to="home">Hello world!</Component>
-
v3.4.10 Changes
October 09, 2018 -
v3.4.9 Changes
September 18, 2018- โ Remove the
injectGlobal
warning; it's not actionable since the replacement API is in v4 only, so why say anything?
- โ Remove the
-
v3.4.8 Changes
September 17, 2018- ๐ Fix the
injectGlobal
warning not being properly guarded for production, by @probablyup
- ๐ Fix the
-
v3.4.7 Changes
September 17, 2018โ Add warning for the upcoming removal of the
injectGlobal
API in v4.0, by @rainboxx (see #1867)๐ Backport from v4: Beef up the error message that sometimes occurs when multiple versions of styled components are used together and the StyleSheet instance can't be found, by @probablyup (see #2012)
-
v3.4.6 Changes
September 10, 2018- ๐ Fix an issue when streaming with very large amounts of output where sometimes styles might not make it to the client, by @probablyup (see #1997)
-
v3.4.5 Changes
August 23, 2018- ๐ Tone down the dev warnings for deprecated APIs (they were
console.error
, nowconsole.warn
), by @probablyup
- ๐ Tone down the dev warnings for deprecated APIs (they were
-
v3.4.4 Changes
August 21, 2018- ๐ Fix warning function not having a production fallback, by @mitoyarzun (see #1938)
-
v3.4.3 Changes
August 21, 2018โ Add warning for the upcoming removal of the
extend
API in v4.0, by @probablyup (see #1909)๐ Throw Error if a React component was mistakenly interpolated within styles, by @imbhargav5 (see #1883)
๐ Fix the primitives build, by @probablyup (see 24f097)