Styled Components 4.0.0 marks a significant update from version 3.4.10, bringing key changes for React developers seeking powerful CSS-in-JS styling. A core difference lies in the dependencies: v4.0.0 introduces @emotion/is-prop-valid and requires babel-plugin-styled-components version 1 or higher as a direct dependency indicating closer integration with emotion's prop validation and Babel's tooling. Version 3.4.10 instead, relied on a more diverse set of utilities such as fbjs, buffer, and supports-color, highlighting a shift towards a leaner core in v4.
For developers, a notable change is reflected in peer dependencies. Version 4.0.0 requires React 16.3.0 or higher, showcasing an evolution of compatible React versions, while v3.4.10 supported a broader range, from React 0.14.0 up to (but not including) React 17. Developers upgrading should ensure their React version meets the new requirement.
The devDependencies also showcase notable differences in the tooling ecosystem, with v4.0.0 upgrading to newer versions of ESLint, Jest and Prettier. Library now has tooling and supports for React Native. This suggests an emphasis on modern development practices, improved linting rules and more convenient way to make snapshot testing. Furthermore, the fileCount in the dist metadata drastically decreases from 314 to only 51, pointing towards significant refactoring and potential tree-shaking improvements making it potentially way faster to use and more productive.
The are not vulnerabilities for the version 4.0.0 of the package styled-components