-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] SvgFromUri doesn't work RN 0.74, New Arch + bridgelessMode ON. Jest tests failed. Patch is provided #2284
Comments
@AptypTheKing Hey, can you share your test case with the reproduction of that bug? We would appreciate that. |
Yes sure, I will provide it. It's very simple actually. Did you check it on bridglessMode ON? It's throwing this error only when it's on. It's ON by default in RN 0.74, but in previous versions it should be done manually. |
Yes, I tested that with bridglessMode ON, on Android and IOS platforms :) |
During jest test I have same error in console, which is on screenshot. But with my patch it's fixed. |
@AptypTheKing can you share how you mocked |
I'm not mocking react-native-svg library, cause I'm testing if my custom Icon component is working as expected.
Everything is working fine on bridglessMode OFF, it's just crashing after I switch it on. |
After talking with @AptypTheKing, we found that the problem he encountered is related to the TypeScript configuration, not the library. |
Bug
On Android, on RN 0.74, New Arch + bridgelessMode ON
SvgFromUri
component is throwing an error. Doesn't appear on bridgelessMode OFF. Working fine tests before are also throwing this error.Not sure about iOS, since we have bridgelessMode OFF there.
Honestly, no idea why this was not throwed before on bridlgessMode OFF, but we have what we have.
Patch provided below. Also can make a PR if SM team find it useful.
React native info output:
Library version:15.1.0
Steps To Reproduce
Short, Self Contained, Correct (Compilable), Example
The error appears in file
src/xml.tsx
, which is throwing error thatchildren.push
cannot be executed. Initially children isnull
which is quite strange, that later we want to use method push on it. TS clearly mark this error.I made a patch of the lib, to prevent a crash assigning children to be an empty array initially.
However JEST tests are also failed, since same code is also appeared in
lib/commonjs/xml.js
andlib/module/xml.js.
Here is the patch below
The text was updated successfully, but these errors were encountered: