styled-components 6.3.2 → 6.3.4

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.
@@ -10,7 +10,7 @@
10
10
  'data-styled';
11
11
  var SC_ATTR_ACTIVE = 'active';
12
12
  var SC_ATTR_VERSION = 'data-styled-version';
13
- var SC_VERSION = "6.3.2";
13
+ var SC_VERSION = "6.3.4";
14
14
  var SPLITTER = '/*!sc*/\n';
15
15
  var IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';
16
16
  /**
@@ -1112,6 +1112,12 @@
1112
1112
  var seen = new Set();
1113
1113
  var checkDynamicCreation = function (displayName, componentId) {
1114
1114
  {
1115
+ // Skip check in RSC environments where:
1116
+ // 1. Components are always module-level (can't be in render functions)
1117
+ // 2. Hook detection is unreliable due to different module evaluation context
1118
+ if (IS_RSC) {
1119
+ return;
1120
+ }
1115
1121
  var parsedIdString = componentId ? " with the id of \"".concat(componentId, "\"") : '';
1116
1122
  var message_1 = "The component ".concat(displayName).concat(parsedIdString, " has been created dynamically.\n") +
1117
1123
  "You may see this warning because you've called styled inside another component.\n" +
@@ -1261,8 +1267,8 @@
1261
1267
  renderStyles(instance, props, ssc.styleSheet, theme, ssc.stylis);
1262
1268
  }
1263
1269
  // Client-side cleanup: conditionally use useLayoutEffect
1264
- // The IS_RSC check is module-level and deterministic, so this doesn't violate rules of hooks
1265
- if (!IS_RSC && typeof React.useLayoutEffect === 'function') {
1270
+ // The false and IS_RSC checks are module-level and deterministic, so this doesn't violate rules of hooks
1271
+ if (!IS_RSC) {
1266
1272
  React.useLayoutEffect(function () {
1267
1273
  return function () {
1268
1274
  globalStyle.removeStyles(instance, ssc.styleSheet);