appandflow / appandflow/react-native-safe-area-context

[Bug] Compilation error with React Native 0.79.x - StyleLength unit() method not found

Ouverte
#731 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
2.8k
Forks
258
Merge moyen
3 j 1 h
PR mergées (30 j)
2

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used [patch-package](https://github.com/ds300/patch-package) to patch `react-native-safe-area-context@4.14.1` for the project I'm working on.

Here is the diff that solved my problem:

```diff
diff --git a/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp b/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp
index 6d94c52..0fe05e5 100644
--- a/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp
+++ b/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp
@@ -16,10 +16,10 @@ inline Style::Length valueFromEdges(
Style::Length edge,
Style::Length axis,
Style::Length defaultValue) {
- if (edge.unit() != Unit::Undefined) {
+ if (!edge.isUndefined()) {
return edge;
}
- if (axis.unit() != Unit::Undefined) {
+ if (!axis.isUndefined()) {
return axis;
}
return defaultValue;
```

This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.