You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.toThrow(`ReactNativeCss: Cannot dynamically add a container context. 'group' was added after the initial render.
33
-
Use modifier ('hover:container', 'active:container', etc) to ensure it present in the initial render`);
35
+
screen.rerender(
36
+
<ViewtestID={parentID}className="group">
37
+
<TexttestID={childID}className="my-class"/>
38
+
</View>,
39
+
);
40
+
41
+
expect(log.mock.calls).toEqual([
42
+
[
43
+
"ReactNativeCss: className 'group' added a container after the initial render. This causes the components state to be reset and all children be re-mounted. This will cause unexpected behavior. Use the className 'will-change-container' to avoid this warning. If this was caused by sibling components being added/removed, use a 'key' prop so React can track the component correctly.",
"ReactNativeCss: className 'group' added a container after the initial render. This causes the components state to be reset and all children be re-mounted. This will cause unexpected behavior. Use the className 'will-change-container' to avoid this warning. If this was caused by sibling components being added/removed, use a 'key' prop so React can track the component correctly.",
`ReactNativeCss: Cannot dynamically add a variable context. '${source}' was added after the initial render.
171
-
Use modifier ('hover:my-var', 'active:my-var', etc) to ensure it present in the initial render`,
169
+
console.log(
170
+
`ReactNativeCss: className '${source}' added a variable after the initial render. This causes the components state to be reset and all children be re-mounted. Use the className 'will-change-variable' to avoid this warning. If this was caused by sibling components being added/removed, use a 'key' prop so React can track the component correctly.`,
`ReactNativeCss: className '${source}' added a container after the initial render. This causes the components state to be reset and all children be re-mounted. This will cause unexpected behavior. Use the className 'will-change-container' to avoid this warning. If this was caused by sibling components being added/removed, use a 'key' prop so React can track the component correctly.`,
179
175
);
180
-
}
181
-
182
-
if(animated!==state.animated){
183
-
thrownewError(
184
-
`ReactNativeCss: Cannot dynamically change to an animated component. '${source}' was added after the initial render.
185
-
Use 'animation-none' or a modifier ('hover:animation', 'active:animation', etc) to ensure it present in the initial render`,
176
+
}elseif(animated!==state.animated){
177
+
console.log(
178
+
`ReactNativeCss: className '${source}' added an animation after the initial render. This causes the components state to be reset and all children be re-mounted. This will cause unexpected behavior. Use the className 'will-change-animation' to avoid this warning. If this was caused by sibling components being added/removed, use a 'key' prop so React can track the component correctly.`,
186
179
);
187
-
}
188
-
189
-
if(pressable!==state.pressable){
190
-
thrownewError(
191
-
`ReactNativeCss: Cannot dynamically change to a Pressable. '${source}' was added after the initial render.
192
-
The 'hover', 'active', and 'focus' modifiers on a View will convert it to a Pressable.
193
-
Use a modifier) to ensure it present in the initial render`,
180
+
}elseif(pressable!==state.pressable){
181
+
console.log(
182
+
`ReactNativeCss: className '${source}' added a pressable state after the initial render. This causes the components state to be reset and all children be re-mounted. This will cause unexpected behavior. Use the className 'will-change-pressable' to avoid this warning. If this was caused by sibling components being added/removed, use a 'key' prop so React can track the component correctly.`,
0 commit comments