2168 Commits

Author SHA1 Message Date
7d705519a4 Add build 2025-02-10 23:27:02 +01:00
94d3eabd22 Handle absence of Buffer on the web 2025-02-10 23:25:57 +01:00
5652952776 Use mjs for peg generation 2025-02-10 23:17:12 +01:00
b4af583fb5 Remove pegjs and use peggy 2025-02-10 23:15:27 +01:00
8fe6338136 Add shell.nix 2025-02-10 23:04:46 +01:00
Jakub Grzywacz
e79a6c198e fix: FeDropShadow results and import react (#2625)
# Summary

* Add results alias in `FeDropShadow`
* Import React in every tsx filter file to satisfy typescript/eslint
* Replace `<>` with `<React.Fragment>` in `FeDropShadow`
2025-01-24 16:34:33 +01:00
Jakub Grzywacz
04d0e89d27 chore: bump package and tests-example to react-native@0.77.0 (#2621)
# Summary

Bumped package and tests-example app from *last* golden release
`react-native@0.77.0-rc.7` to stable `react-native@0.77.0` and tested
for regression.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| Android |          |

## Checklist

<!-- Check completed item, when applicable, via: [X] -->

- [x] I have tested this on a device and a simulator
2025-01-22 13:05:19 +01:00
Jakub Grzywacz
f2ce29dabe fix: don't set zero dimensions on RNSVGGroup (#2612)
# Summary

Fixes #2610

It's more of a hack than the best fix for that; however, it's a
regression that we should address.

## Test Plan
Test case provided in #2610
2025-01-20 12:01:47 +01:00
Jakub Grzywacz
476df53618 chore: upgrade react-native to 0.77.0-rc.7 (#2618)
# Summary

Upgrade `tests-example` to `react-native@0.77.0-rc.7`
2025-01-17 10:58:53 +01:00
Jakub Grzywacz
81eb2fb357 fix: ios build CI (#2605)
# Summary

Apparently there are some issues with newer xcode versions on GitHub CI

Similar changes have been made in Gesture Handler
https://github.com/software-mansion/react-native-gesture-handler/pull/3319/
and Screens
https://github.com/software-mansion/react-native-screens/pull/2620
2025-01-17 10:23:19 +01:00
Jakub Grzywacz
de8a7632f6 fix: properly handle touch events outside the Svg (#2611)
# Summary

Fixes #2585 

Improve the `onPress` events by ignoring touches outside the `Svg` view.
This is implemented as follows:
* on Android by clipping the Android's element dimensions to (0, 0,
canvas width, canvas height)
* on Apple by improving `hitTest` to exclude touches outside the bounds
of (0, 0, bounds width, bounds height)


https://github.com/user-attachments/assets/59417493-d849-47df-84e8-d5b0a6045b00
2025-01-15 11:49:55 +01:00
Ignacy Łątka
3bf4298ae0 feat: make svgView getter public (#2583)
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect -->

# Summary

This PR reverts #2555, as `RenderableView.hitTest()` can be replaced by
`SvgView.reactTagForTouch()`, which is already `public`.

This PR also changes the `package-private` `getSvgView()` method of
`VirtualView` to `public`.
This change has been made to handle hit detection of transformed
`VirtualView`s, as `RenderableView`'s `hitTest()` doesn't take
transformations into account, while `SvgView`'s `reactTagForTouch()`
does.

Making `getSvgView()` public is necessary for integrating RNSVG support
into RNGH. More details
[here](https://github.com/software-mansion/react-native-gesture-handler/pull/3242/).

## Test Plan

Run the example from the RNGH - RNSVG [integration
PR](https://github.com/software-mansion/react-native-gesture-handler/pull/3242/).

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
2025-01-15 11:27:35 +01:00
Jakub Grzywacz
9ed8eb1587 Release 15.11.1 2025-01-09 21:00:44 +01:00
Jakub Grzywacz
7f6fa1026b fix: include scripts/rnsvg_utils.rb in release (#2607)
# Summary

Hotfix for #2606, where `RNSVG.podspec` imports `scripts/rnsvg_utils.rb`
but `scripts` catalog is not included in the release.

Closes #2606

# Issue
```bash
❯ bundle exec pod install

[!] Invalid `Podfile` file:
[!] Invalid `RNSVG.podspec` file: cannot load such file -- /node_modules/react-native-svg/scripts/rnsvg_utils.

 #  from /node_modules/react-native-svg/RNSVG.podspec:2
 #  -------------------------------------------
 #  require 'json'
 >  require_relative './scripts/rnsvg_utils'
 #
 #  -------------------------------------------
```
2025-01-09 20:59:38 +01:00
Jakub Grzywacz
6d353737b3 Release 15.11.0 2025-01-09 17:03:59 +01:00
Jakub Grzywacz
73bdb03f4c fix: CMake flags (#2603)
# Summary

Fix typo in CMakeLists.txt flags and use `ReactAndroid_VERSION_MINOR`
instead of `REACT_NATIVE_MINOR_VERSION`

## Test Plan

Example apps should build without warnings/errors on 0.73+ as well as on
0.77.0-rc.6
2025-01-08 10:30:37 +01:00
Jakub Grzywacz
d888de904e refactor: update eslint disable comments after config changes (#2602)
# Summary

* update eslint-disable comments after config changes
* run bundle exec pod install in tests-example
2025-01-07 15:58:28 +01:00
Jakub Grzywacz
18f2fcdcd1 chore: bump tests-example to react-native@0.77.0-rc.6 (#2601)
# Summary

Bump tests-example to react-native@0.77.0-rc.6

## Test Plan

`Tests-example` should compile
2025-01-07 15:18:47 +01:00
Jakub Grzywacz
1e1f140b15 chore: update generated specs for the old architecture to work on 0.77 (#2586)
# Summary

Similarly to
https://github.com/software-mansion/react-native-gesture-handler/pull/3301
we need to regenerate specs

## Test Plan

CI should be green
2025-01-07 15:09:41 +01:00
Jakub Grzywacz
6377be5f20 fix: remove package from AndroidManifest.xml (#2600)
# Summary

Fixes #2599 

Starting with `v15.8.0`, we support `react-native@0.73+`, which
eliminates the need to worry about AGP versions below 7. Consequently,
the `package` attribute in `AndroidManifest.xml` can be safely removed,
along with the corresponding check in `build.gradle`.

## Test Plan

Build the app on all supported versions

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
2025-01-07 14:43:58 +01:00
Jakub Grzywacz
c7743f1a41 chore: bump react-native and other packages (#2598)
# Summary

* Bump react-native and other packages (babel, eslint, prettier,
`@types`) to resolve errors in
https://github.com/software-mansion/react-native-svg/pull/2586
* Cleanup unused/unnecessary devDependencies 

## Test Plan

Lib should work exactly the same as before.
2025-01-07 14:28:14 +01:00
Jakub Grzywacz
6042b89b6b feat: use yoga::StyleLength instead of yoga::value on 77+ (#2582)
# Summary

With react-native@0.77 `yoga::value` is no longer available and we
should use `yoga::StyleLength`.

## Test Plan

App should build again on 0.77.rc-3
2024-12-19 14:34:55 +01:00
Jakub Grzywacz
b4fa586ab8 feat: allow single quote ID wrapper (#2580)
# Summary  

The SVG specification does not strictly standardize linking, and most
browsers permit the use of `'` as a wrapper in `url` links. As a result,
I've added support for URLs such as `url('#id')`.

## Test Plan

`url(#id)` and `url('#id')` should do the exact same thing.


Closes #1768
2024-12-17 10:58:14 +01:00
Jakub Grzywacz
490d09e229 chore: fabric macos example CI (#2579)
# Summary

Fix `fabric-macos-example` CI 

## Test Plan

Ci should be green
2024-12-16 14:26:52 +01:00
Jakub Grzywacz
a9e702c462 test: fix e2e tests (#2578)
# Summary

Fix broken E2E iOS tests

## Test Plan

CI should be green
2024-12-16 13:14:31 +01:00
Boaz Arad
d49783040d fix: currentColor stale value (#2573)
# Summary
This is another fix for issue
https://github.com/software-mansion/react-native-svg/issues/2566 that
also resets the color on prepareForRecycle (in the same manner of this
fix https://github.com/software-mansion/react-native-svg/pull/2570). I
also don't have a sandboxed reproduce, but was able to verify the fix on
my company's code which I unfortunately can't share.

## Compatibility
OS | Implemented
-- | --
iOS | 
MacOS | 

Co-authored-by: Jakub Grzywacz <jakub.grzywacz@swmansion.com>
2024-12-16 12:18:51 +01:00
Jakub Grzywacz
596ba83454 remove: *.metal from podspec source_files (#2576)
# Summary

Fixes #2571.
Since filter shaders are already provided as compiled `*.metallib`
files, there is no need to include `*.metal` files in the `source_files`
list.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
2024-12-12 11:49:19 +01:00
Jakub Grzywacz
d3d61a5fc1 feat: custom shadow nodes (#2568)
# Summary

Implement custom shadow nodes for nearly all `Svg` components. While
it's a foundation for numerous upcoming changes, it currently addresses
and resolves #2544.

## Test Plan

There shouldn't be any noticeable changes, and everything should
function as before, except that `onLayout` will now be triggered only
once and with the correct dimensions.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| MacOS   |          |
| Android |          |

---------

Co-authored-by: Jakub Piasecki <jakubpiasecki67@gmail.com>
2024-12-12 11:48:46 +01:00
Jakub Grzywacz
bf1c32d9a5 feat: add codegen ios.componentProvider (#2572)
# Summary

Add a newly introduced field `ios.componentProvider` to the `codegen`
configuration to create an association map between JS components and
their native implementations.

When this field is defined, it is used and codegen don't crawl the file
system looking for the mapping. You can find the documentation for it
here:
https://github.com/facebook/react-native-website/pull/4388/files#diff-7fbb6ff2e58f8bd50d2763e551c63e1816adb6d593f40d489785b575b0e82718R76

## Test Plan

Running `pod install` in the `tests-example` will currently hang and
eventually crash, as it attempts to crawl through the entire repository.
2024-12-10 17:03:47 +01:00
Jakub Grzywacz
856142eb25 fix: currentColor overflow (#2570)
# Summary  

This is a blind fix for issue #2566 that resets the caller on
`prepareForRecycle`. While it should help address the overflow happening
in some cases, I cannot guarantee that it will fully resolve the issue
due to the lack of a reproducible scenario.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| MacOS   |          |
2024-12-10 11:15:27 +01:00
Jakub Grzywacz
de6b4d0d17 chore: bump TestsExample to react-native@0.77.0-rc.1 (#2556)
# Summary

Bump TestsExample to `react-native@0.77.0-rc.1` to track compatibility
with the latest version

## Test Plan

`TestsExample` should compile.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| Android |          |
2024-12-09 16:33:53 +01:00
Abed El Rahman Al Tawil
d1e91144a7 refactor: use old style switch statement in FeCompositeView.java (#2562)
Use old-style switch statement in `FeCompositeView.java`.
2024-12-06 16:34:49 +01:00
Jakub Grzywacz
c59eb295db Release 15.10.1 2024-12-05 11:41:55 +01:00
Jakub Grzywacz
488613562b fix: do not parse id as number in any case (#2563)
# Summary

When using `SvgXml` or `SvgCss`, an `id` attribute gets converted into a
`number` instead of a `string`, which causes a crash because the native
side expects a string value.

```js
import {SvgXml} from 'react-native-svg';
import {SvgCss} from 'react-native-svg/css';
```

## Test Plan

This example should not crash:
```jsx
import {SvgCss} from 'react-native-svg/css';

const svgXml = `
<svg width="100" height="100" viewBox="0 0 100 100">
  <filter x="0%" y="0%" width="100" height="100" id="0123456789">
    <feFlood flood-color="red" />
  </filter>
  <circle cx="50" cy="50" r="50" filter="url(#0123456789)" />
</svg>
`;

function Example() {
  return <SvgCss xml={svgXml} />;
}
```
2024-12-05 11:15:32 +01:00
Jakub Grzywacz
3b5c5f0593 Release 15.10.0 2024-12-03 12:54:54 +01:00
Jakub Grzywacz
1c9a553db0 fix: FeComposite add default value for k1...4 (#2557)
# Summary

Fixes #2552 by adding default value for k1, k2, k3, k4 according to the
spec: https://www.w3.org/TR/SVG11/filters.html#feCompositeElement

> If the attribute is not specified, the effect is as if a value of 0
were specified.

## Test Plan

[Repro from issue
2552](https://github.com/TomCorvus/RNSVG/blob/main/App.js)

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| MacOS   |          |
2024-12-02 13:32:51 +01:00
Ignacy Łątka
01db444f51 feat: make RenderableView.hitTest public to create a cross-library interface (#2555)
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect -->

# Summary

Adding an `RNGH <-> RNSVG` interface requires usage of
`RenderableView.hitTest` to work.
([link](https://github.com/software-mansion/react-native-gesture-handler/pull/3242))
Currently, `RenderableView.hitTest` is `package-private`, meaning it
cannot be accessed by other packages.
This change does not change any functionality of the library, it only
exposes existing functions to other libraries.

I only made public those `hitTest` implementation which are strictly
necessary for this interface, this is why multiple, if not most
`hitTest` implementations remain `package-private` despite the changes
made in the PR.

## Test Plan

- open the example app, see how the app builds successfully

### What's required for testing (prerequisites)?

- `RNSVG`'s `paper-example` app

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

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| MacOS   |          |
| Android |          |
| Web     |          |

## Checklist

<!-- Check completed item, when applicable, via: [X] -->

- [X] I have tested this on a device and a simulator
- [ ] I added documentation in `README.md`
- [ ] ~~I updated the typed files (typescript)~~
- [ ] I added a test for the API in the `__tests__` folder
2024-11-28 17:05:43 +01:00
Jakub Grzywacz
2dcc8324b6 refactor: replace deprecated processTransform (#2554)
# Summary

Replace deprecated `TransformHelper.processTransform` with a new
function that also gets `transformOrigin`.

## Test Plan

Transforms should function properly, and this error should not occur
during the build process:
```
> Task :react-native-svg:compileDebugJavaWithJavac
/react-native-svg/apps/paper-example/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:390: warning: [removal] processTransform(ReadableArray,double[]) in TransformHelper has been deprecated and marked for removal
    TransformHelper.processTransform(transforms, sTransformDecompositionArray);
                   ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
```

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
2024-11-28 15:29:45 +01:00
Jakub Grzywacz
c617dec1c5 fix: animated transform last frame (#2553)
# Summary

When using the Animated API for animations, it sends the last frame as
JavaScript-parsed (matrix) updates in addition to native (transform)
updates. ~~As a result, we need to ignore one of them.~~ I believe
there's no need to differentiate between native and JavaScript
updates—we can simply save both to the same value (mMatrix). By doing
so, we can avoid duplicating the transforms.

| Before | After |
|--------|--------|
| <video
src="https://github.com/user-attachments/assets/868cc778-4b88-4473-85b5-9665b4b241aa">
| <video
src="https://github.com/user-attachments/assets/c6d17b7b-7c9a-47c3-8286-2d9b5720f261">
|




## Test Plan

```jsx
import React, {useEffect} from 'react';
import {Animated, useAnimatedValue, View} from 'react-native';
import {Rect, Svg} from 'react-native-svg';

const AnimatedRect = Animated.createAnimatedComponent(Rect);
function AnimatedJumpIssue() {
  const animatedValue = useAnimatedValue(100);
  return (
    <>
      <View style={{borderColor: 'black', borderWidth: 1}}>
        <Svg height="100" width="400">
          <AnimatedRect
            x="0"
            y="0"
            width="100"
            height="100"
            fill="black"
            transform={[{translateX: animatedValue}]}
          />
        </Svg>
      </View>
      <Button
        title="Press me"
        onPress={() => {
          Animated.timing(animatedValue, {
            toValue: 200,
            duration: 3000,
            useNativeDriver: true,
          }).start();
        }}
      />
    </>
  );
}
```

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
| iOS |          |
| macOS |          |
2024-11-28 12:44:55 +01:00
Jakub Grzywacz
d125be1819 fix: getBBox size (#2549)
# Summary

When calling `getBBox` on rect, it will not give correct dimensions as
`markers` that are 90% `CGRectZero` so CGRectUnion between some values
and (0, 0, 0, 0) will return (0, 0, width, height)

## Test Plan

```tsx
import React, { useRef } from 'react';
import { Button, View } from 'react-native';
import { Rect, Svg } from 'react-native-svg';

function App(): React.JSX.Element {
  const ref1 = useRef<Rect>(null);

  return (
    <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
      <Svg width={300} height={300}>
        <Rect
          x={100}
          y={100}
          width={100}
          height={100}
          fill="red"
          opacity={0.5}
          ref={ref1}
        />
      </Svg>
      <Button
        title="Press me"
        onPress={() => console.log(ref1.current?.getBBox())}
      />
    </View>
  );
}

export default App;
```

Before: return `{"height": 100, "width": 100, "x": 0, "y": 0}`
After: return `{"height": 100, "width": 100, "x": 100, "y": 100}`

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| MacOS   |          |
2024-11-21 10:37:54 +01:00
Jakub Grzywacz
d1d936a834 fix: resolve transforms on new architecture (#2542)
# Summary

Add `resolveTransforms` on `updateProps` to get correct matrix. It will
improve animating transformations, as Animated/Reanimated skips JS
`processTransform` and passes transformations directly.

## Test Plan

Animate `transform` prop in react-native style.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| MacOS   |          |
2024-11-20 10:42:39 +01:00
Jakub Grzywacz
74b77a672e fix: react-native@0.73 sourceSet to maintain support (#2543)
# Summary

#2541 is not compatible with `react-native@0.73`. This PR introduces
sourceSet to maintain support for that version.

## Test Plan

Build app with `react-native@0.73.x`

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
2024-11-19 13:54:39 +01:00
Pieter De Baets
81e4692885 feat: update SvgPackage to supported stable API's (#2541)
Address some deprecated API's in SVGPackage

# Summary

This improves compatibility with future React Native releases, which
will remove TurboReactPackage and the ReactModuleInfo constructor used.

## Test Plan

CI
2024-11-19 10:02:49 +01:00
Jakub Grzywacz
e85c727b79 chore: fix paper-macos-example workflow (#2539)
# Summary

Regenerate pods to fix `paper-macos-example` workflow.
`fabric-macos-example` will still fail as it doesn't have any startup
command, but it's not our fault.

## Test Plan

CI for `peper-macos-example` should be green
2024-11-19 09:55:05 +01:00
Jakub Grzywacz
0c30339c55 refactor: use old style switch statement (#2538)
# Summary

Use old-style switch statement.
Closes #2537
2024-11-18 10:43:17 +01:00
Jakub Grzywacz
08b1f53147 fix: remove fill and stroke when its unset (#2536)
# Summary

Closes #2535
When `fill` or `stroke` is set to `'none'` we should remove the value
instead of keeping the last valid value.

## Test Plan

```tsx
import React, {useState} from 'react';
import {Text, TouchableOpacity} from 'react-native';
import {Path, Rect, Svg} from 'react-native-svg';

function Example() {
  const [color, setColor] = useState('#0000FF');
  return (
    <>
      <Svg width={120} height={150} viewBox="0 0 12 15" fill="none">
        <Path
          d="M1 3.353C1 2.053 2.053 1 3.353 1H8.647C9.947 1 11 2.053 11 3.353V13.207C11 13.3008 10.9736 13.3927 10.9238 13.4722C10.874 13.5518 10.8029 13.6157 10.7185 13.6567C10.6341 13.6976 10.5399 13.7141 10.4466 13.7041C10.3533 13.694 10.2648 13.658 10.191 13.6L7.202 11.25C6.99452 11.0876 6.7385 10.9995 6.475 11H3.353C2.72895 11 2.13045 10.7521 1.68918 10.3108C1.2479 9.86955 1 9.27105 1 8.647V3.353Z"
          stroke={color}
          fill={color}
          strokeOpacity={0.5}
          strokeWidth={1.5}
        />
      </Svg>
      <TouchableOpacity onPress={() => setColor('none')}>
        <Text>Click to remove color</Text>
      </TouchableOpacity>
    </>
  );
}
```

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| macOS   |          |
2024-11-15 13:13:36 +01:00
Andrew Coates
d02c997352 fix: react-native-windows implementation for new architecture (#2527)
# Summary
There are two main things going on with the PR. Both involve a reworking
of the new arch implementation of rn-svg for windows.
The current implementation attempts to implement a svg renderer from
scratch. There are numerous edge cases that it wasn't handling
correctly, and the performance had some serious issues. This
implementation switches to use the svg rendering path built into
Direct2D. This brings significant performance improvements.

The 2nd issue is there have been various breaking changes in
react-native-windows for how new arch native components are implemented.
This brings the rn-svg implementation in line with those latest changes.

## Test Plan

Primary testing right now is loading up the example app in the repo.
New arch on react-native-windows is still in somewhat early days - so
there are not really current users of this code. I am integrating this
code into Microsoft Office, where I have tested some scenarios. But we
will get expanded testing as we roll out the new arch. I expect there to
be some follow-ups as we expand our usage. The version of rn-svg before
this PR doesn't build with the latest new arch react-native-windows
versions. - So its hard to get worse than that.

### What's required for testing (prerequisites)?

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

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |    N/A  |
| MacOS   |    N/A      |
| Android |    N/A      |
| Web     |          |

## Checklist

- [x] I have tested this on a device and a simulator
- [ ] I added documentation in `README.md`
- [ ] I updated the typed files (typescript)
- [ ] I added a test for the API in the `__tests__` folder
2024-11-15 12:17:12 +01:00
Jakub Grzywacz
6aff3094ce fix: filters memory leak on apple (#2534)
# Summary

While animating filters, I discovered a memory leak due to not releasing
the `CGImage` after creating the mask.

## Test Plan

```tsx
import {useEffect} from 'react';
import Animated, { useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
import Svg, {FeOffset, Filter, Rect} from 'react-native-svg';

const AnimatedFilter = Animated.createAnimatedComponent(Filter);
const AnimatedFeOffset = Animated.createAnimatedComponent(FeOffset);
const AnimatedRect = Animated.createAnimatedComponent(Rect);
export default function Example() {
  const offset = useSharedValue(0.5);

  useEffect(() => {
    offset.value = withRepeat(withTiming(300, {duration: 3000}), -1, true);
  }, []);

  return (
    <Svg height="300" width="300">
      <AnimatedFilter id="filter">
        <AnimatedFeOffset dx={offset} dy={offset} result="offOut" />
      </AnimatedFilter>
      <AnimatedRect
        x="0"
        y="0"
        width="300"
        height="300"
        fill="red"
        filter="url(#filter)"
      />
    </Svg>
  );
}
```

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| macOS   |          |
2024-11-15 12:00:12 +01:00
Jakub Grzywacz
bba8b3f0a8 Release 15.9.0 2024-11-13 14:22:18 +01:00
Jakub Grzywacz
1256d561df fix: react-native-macos@0.76+ (#2531)
# Summary

On `react-native-macos` 0.76, `UIGraphicsBeginImageContextWithOptions`
and some other UIGraphics directives were removed so the temporary
solution is to copy the removed functions here.

More details
here https://github.com/software-mansion/react-native-svg/issues/2528
and here https://github.com/microsoft/react-native-macos/pull/2209

Closes #2528

## Test Plan

Built the `fabric-macos-example` for with `react-native-macos@0.76.0`

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| MacOS   |          |

## Checklist

- [x] I have tested this on a device and a simulator
2024-11-13 12:30:05 +01:00