[Bug] Compilation error with React Native 0.79.x - StyleLength unit() method not found
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp and reproduce the compilation failure against React Native 0.79.x. Compare the reported Style::Length API usage with the version in that React Native release, then build the relevant native target and verify that the safe-area context package compiles without the error.
Written by the indexing model from the issue text.
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used 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 --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.
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 259
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from appandflow/react-native-safe-area-context
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
appandflow/react-native-safe-area-context#742 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
appandflow/react-native-safe-area-context#739 · 1 comment ·
-
good first issue help wanted Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
appandflow/react-native-safe-area-context#216 · 5 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
appandflow/react-native-safe-area-context#774 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
appandflow/react-native-safe-area-context#758 · 2 reactions ·
All issues in appandflow/react-native-safe-area-context
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100