Skip to content

Commit a568d7b

Browse files
authored
Fix Error in measure not throwing (#1956)
## Description `measure` checks if the `x` values is exactly `-1234567.0` - if it is, it's an error. if it isn't, a result is available. We returned an incorrect vector from the native `measure` function. ## Changes - Updated native method `measure` to correctly return error-ish values <!-- ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before ### After --> ## Test code and steps to reproduce <!-- Please include code that can be used to test this change and short description how this example should work. This snippet should be as minimal as possible and ready to be pasted into editor (don't exclude exports or remove "not important" parts of reproduction example) --> ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
1 parent 824e5df commit a568d7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ios/native/NativeMethods.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
UIView *rootView = view;
1111

1212
if (view == nil) {
13-
return std::vector<std::pair<std::string, double>>(0, std::make_pair("x", -1234567.0));
13+
return std::vector<std::pair<std::string, double>>(std::make_pair("x", -1234567.0));
1414
}
1515

1616
while (rootView.superview && ![rootView isReactRootView]) {
1717
rootView = rootView.superview;
1818
}
1919

2020
if (rootView == nil || (![rootView isReactRootView])) {
21-
return std::vector<std::pair<std::string, double>>(0, std::make_pair("x", -1234567.0));
21+
return std::vector<std::pair<std::string, double>>(std::make_pair("x", -1234567.0));
2222
}
2323

2424
CGRect frame = view.frame;

0 commit comments

Comments
 (0)