styled-components 6.5.0 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@
11
11
  'data-styled';
12
12
  const SC_ATTR_ACTIVE = 'active';
13
13
  const SC_ATTR_VERSION = 'data-styled-version';
14
- const SC_VERSION = "6.5.0";
14
+ const SC_VERSION = "6.5.1";
15
15
  const SPLITTER = '/*!sc*/\n';
16
16
  const IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';
17
17
  function readSpeedyFlag(name) {
@@ -2185,13 +2185,6 @@
2185
2185
  }
2186
2186
  return nextKeyCount === prevKeyCount;
2187
2187
  }
2188
- function useInjectedStyle(componentStyle, resolvedAttrs, styleSheet, stylis) {
2189
- const className = componentStyle.generateAndInjectStyles(resolvedAttrs, styleSheet, stylis);
2190
- if (React.useDebugValue) {
2191
- React.useDebugValue(className);
2192
- }
2193
- return className;
2194
- }
2195
2188
  function resolveContext(attrs, props, theme) {
2196
2189
  const context = Object.assign(Object.assign({}, props), {
2197
2190
  // unset, add `props.className` back at the end so props always "wins"
@@ -2278,7 +2271,7 @@
2278
2271
  }
2279
2272
  else {
2280
2273
  context = resolveContext(componentAttrs, props, theme);
2281
- generatedClassName = useInjectedStyle(componentStyle, context, ssc.styleSheet, ssc.stylis);
2274
+ generatedClassName = componentStyle.generateAndInjectStyles(context, ssc.styleSheet, ssc.stylis);
2282
2275
  let propsKeyCount = 0;
2283
2276
  for (const key in props) {
2284
2277
  if (hasOwn.call(props, key))
@@ -2296,6 +2289,11 @@
2296
2289
  ];
2297
2290
  }
2298
2291
  }
2292
+ // Outside the render-cache branch: a hook skipped on a cache hit is a hook
2293
+ // count that changes between renders, which React rejects outright (#5788).
2294
+ if (React.useDebugValue) {
2295
+ React.useDebugValue(generatedClassName);
2296
+ }
2299
2297
  if (forwardedComponent.warnTooManyClasses) {
2300
2298
  forwardedComponent.warnTooManyClasses(generatedClassName);
2301
2299
  }