Commit Graph

7 Commits

Author SHA1 Message Date
Bohdan Artiukhov
2b6ced416b feat: format project and change in test example default component (#2350)
# Summary
Format the whole project.
2024-07-18 12:45:36 +02:00
Tomek Zawadzki
1de7709176 Add missing #import <folly/dynamic.h> on RN 0.75 (#2344)
Currently, react-native-svg fails to compile on Android with react-native@0.75.0-rc.4 and new architecture enabled due to an unknown identified folly::dynamic.

This PR adds the missing import so that the identifier has a declaration.
2024-07-11 09:59:57 +02:00
Bohdan Artiukhov
c0ee3e9ca0 add onLoad prop to Image component (#2293)
# Summary

Closes #1442

We want to add new props to the Image Component.

## Test Plan

Added the Test component. 
Manually test that in Android and IOS platforms on new and old
Architectures.

### What are the steps to reproduce (after prerequisites)?

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |         |
| Android |         |
2024-06-27 16:10:28 +02:00
Wojciech Lewicki
03ca039497 feat: add support for RN 73 (#2181)
PR bumping the library code to compile on new arch on RN 0.73.x and restoring the proper configuration of Image component on new arch on Android.

Also bumping the FabricExample to check if the code works correctly.
2023-12-01 11:58:49 +01:00
Pieter De Baets
5208a2f6a7 perf: avoid unnecessary shared_ptr copies in Fabric components (#2164)
Ports the upstream best-practice around props handling of shared_ptr in a855013fc6
2023-10-25 12:23:14 +02:00
Hampus Sjöberg
50b555cde4 Fix syntax error in RNSVGImageShadowNode::initialStateData (#2079)
Fix syntax error in RNSVGImageShadowNode::initialStateData
2023-07-05 17:42:13 +02:00
Wojciech Lewicki
1126079425 feat: use codegenNativeComponent to import native views (#1847)
Changed `requireNativeComponent` to `codegenNativeComponent` so that upcoming changes (Static View Configs, Bridgeless Mode and idk what more) in `react-native` are available in the library. Also, types and native components are now taken directly from `fabric` folder to make sure the values passed to the native components are the ones defined in props. It should work on all supported versions since `codegenNativeComponent` function exists from RN v. 0.61.0. Suggested by @RSNara and @cipolleschi

Reason for [`5394bbb` (#1847)](5394bbbced): 
- on `Paper`, `Animated` uses `setNativeProps` method when we set `useNativeDriver`  to `false`, and does not rerender the component. Therefore, new transform lands only in `SvgView` and is parsed in `RCTViewManager.m` .
- on `Fabric`, the same code makes the components rerender. Due to this, information about new transform is passed to the `SvgView` child: `G` , making it apply translations from the transform in its `updateProps` method.
- other than `Animated` use-case, on both archs, if we just passed `transform` prop to `Svg` component, it would end up in double transformations now as well. All of those changes are due to https://github.com/software-mansion/react-native-svg/pull/1895, which added proper parsing of RN style `transform` prop (array of transformations objects) therefore making `G` properly handle `transform` prop passed from `Svg`.

Reason for [`19bcb24` (#1847)](19bcb2464b): Same as https://github.com/software-mansion/react-native-screens/pull/1624
2022-11-03 15:47:29 +01:00