react-native-unistyles 3.2.1 → 3.2.2

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.
@@ -68,27 +68,15 @@ void core::UnistylesRegistry::linkShadowNodeWithUnistyle(
68
68
  if (_suspendedFamilies.erase(shadowNodeFamily) > 0) {
69
69
  auto* mutableFamily = const_cast<ShadowNodeFamily*>(shadowNodeFamily);
70
70
  mutableFamily->nativeProps_DEPRECATED.reset();
71
+ // Clear old registry entries to prevent stale UnistyleData accumulation
72
+ this->_shadowRegistry.erase(shadowNodeFamily);
73
+ // Remove any stale traffic controller entry (e.g. from a theme change during suspension)
74
+ this->trafficController.removeShadowNode(shadowNodeFamily);
71
75
  }
72
76
 
73
- shadow::ShadowLeafUpdates updates;
74
- auto parser = parser::Parser(nullptr);
75
-
76
77
  std::for_each(unistylesData.begin(), unistylesData.end(), [this, shadowNodeFamily](std::shared_ptr<UnistyleData> unistyleData){
77
78
  this->_shadowRegistry[shadowNodeFamily].emplace_back(unistyleData);
78
79
  });
79
-
80
- updates[shadowNodeFamily] = parser.parseStylesToShadowTreeStyles(rt, unistylesData);
81
-
82
- auto* mutableFamily = const_cast<ShadowNodeFamily*>(shadowNodeFamily);
83
-
84
- if (mutableFamily->nativeProps_DEPRECATED) {
85
- mutableFamily->nativeProps_DEPRECATED->update(updates[shadowNodeFamily]);
86
- } else {
87
- mutableFamily->nativeProps_DEPRECATED = std::make_unique<folly::dynamic>(updates[shadowNodeFamily]);
88
- }
89
-
90
- this->trafficController.setUpdates(updates);
91
- this->trafficController.resumeUnistylesTraffic();
92
80
  });
93
81
  }
94
82
 
@@ -13,10 +13,13 @@ jsi::Value HybridShadowRegistry::link(jsi::Runtime &rt, const jsi::Value &thisVa
13
13
  auto& registry = core::UnistylesRegistry::get();
14
14
 
15
15
  // this is special case for Animated, and prevents appending same unistyles to node
16
- registry.removeDuplicatedUnistyles(&shadowNodeWrapper->getFamily(), unistyleWrappers);
16
+ // skip for suspended families - they need a full re-link with fresh UnistyleData
17
+ if (!registry.isSuspended(&shadowNodeWrapper->getFamily())) {
18
+ registry.removeDuplicatedUnistyles(&shadowNodeWrapper->getFamily(), unistyleWrappers);
17
19
 
18
- if (unistyleWrappers.empty()) {
19
- return jsi::Value::undefined();
20
+ if (unistyleWrappers.empty()) {
21
+ return jsi::Value::undefined();
22
+ }
20
23
  }
21
24
 
22
25
  for (size_t i = 0; i < unistyleWrappers.size(); i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "NODE_ENV=babel-test jest ./plugin ./src/__tests__",
@@ -145,13 +145,13 @@
145
145
  "@babel/plugin-syntax-jsx": "7.28.6",
146
146
  "@babel/runtime": "7.28.6",
147
147
  "@react-native/babel-preset": "0.83.2",
148
- "nitrogen": "0.35.2",
148
+ "nitrogen": "0.35.3",
149
149
  "oxfmt": "0.35.0",
150
150
  "oxlint": "1.50.0",
151
151
  "react": "19.2.0",
152
152
  "react-native": "0.83.2",
153
153
  "react-native-builder-bob": "0.40.18",
154
- "react-native-nitro-modules": "0.35.2",
154
+ "react-native-nitro-modules": "0.35.3",
155
155
  "react-native-reanimated": "4.2.2",
156
156
  "react-native-web": "0.21.2",
157
157
  "typescript": "5.9.3"