Skip to content

Commit 684a759

Browse files
authored
feat: Add react-native 0.78 support (#578)
In react-native 0.78, they removed `StyleLength::unit()`. Instead, you can check `StyleLength::isUndefined()` directly, which achieves the same thing. Technically not backwards compatible, but I remember Janic saying the policy for new arch is to not be backwards compatible until it is stable and used by (pretty much) everyone.
1 parent 10d2e7b commit 684a759

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ inline Style::Length valueFromEdges(
1616
Style::Length edge,
1717
Style::Length axis,
1818
Style::Length defaultValue) {
19-
if (edge.unit() != Unit::Undefined) {
19+
if (!edge.isUndefined()) {
2020
return edge;
2121
}
22-
if (axis.unit() != Unit::Undefined) {
22+
if (!axis.isUndefined()) {
2323
return axis;
2424
}
2525
return defaultValue;

0 commit comments

Comments
 (0)