Comments (7)
I'm not mocking react-native-svg library, cause I'm testing if my custom Icon component is working as expected.
function Icon({ style, source, size = IconSizes.medium, testID }: Props): React.JSX.Element | null {
if (!source) return null
if (isURL(source)) {
return (
<SvgFromUri
fill={style?.color}
height={ICON[size].fontSize}
testID={testID}
uri={source}
width={ICON[size].fontSize}
/>
)
}
const FontelloIcon = createIconSetFromFontello(fontelloConfig)
return (
<FontelloIcon
name={source}
style={[style, ICON[size]]}
testID={testID}
/>
)
}
Everything is working fine on bridglessMode OFF, it's just crashing after I switch it on.
from react-native-svg.
@AptypTheKing Hey, can you share your test case with the reproduction of that bug? We would appreciate that.
We checked that in New Arch and Old Arch but didn't get that error.
from react-native-svg.
@AptypTheKing Hey, can you share your test case with the reproduction of that bug? We would appreciate that.
We checked that in New Arch and Old Arch but didn't get that error.
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.
from react-native-svg.
@AptypTheKing Hey, can you share your test case with the reproduction of that bug? We would appreciate that.
We checked that in New Arch and Old Arch but didn't get that error.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 :)
from react-native-svg.
it('Snapshot source from link', () => {
const component = renderComponent(
<SvgFromUri
height={16}
uri='https://www.svgrepo.com/show/22031/home-icon-silhouette.svg'
width={16},
/>
)
setTimeout(() => {
const tree = component.toJSON()
expect(tree).toMatchSnapshot()
}, 2000)
})
During jest test I have same error in console, which is on screenshot. But with my patch it's fixed.
from react-native-svg.
@AptypTheKing can you share how you mocked react-native-svg
library, please
I want to reproduce the same steps as you :)
from react-native-svg.
After talking with @AptypTheKing, we found that the problem he encountered is related to the TypeScript configuration, not the library.
from react-native-svg.
Related Issues (20)
- React native web + vitest issue - Cannot use import statement outside a module HOT 6
- fetchText method error : TypeError: Cannot read property 'prototype' of undefined when trying to call svg from uri HOT 5
- HTML entities contained in an XML string are not decoded by the SvgXml component HOT 1
- Path not rendering correctly HOT 1
- How to center Text along a path?
- React Native SVG stroke-width bug on expo web. HOT 1
- SVG image not import in React native HOT 3
- ForeignObject works with panResponder? HOT 2
- Why is `err` exported?
- stroke-width default value must be 1
- Error "ViewPropTypes" undefined in svg.js file HOT 1
- defaultProps issue with React version 18.3 HOT 4
- Comments in SVG file results in "Text strings must be rendered within a <Text> component." HOT 1
- Svg is blur on react-native-windows
- Build failed on react-native 0.74.0 & newArchEnabled HOT 1
- ERROR Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider, js engine: hermes
- Image gets tiled instead of centered.
- <image> tag in Svg not rendering properly in iOS while it's working properly in Android/Web HOT 2
- C/C++ Problem with RN-SVG HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-svg.