---
title: "Comment by Hsiangyu Hu on \"How to do freehand tracing with React Native?\" | Hashnode"
description: "Here's an example of how you could do diffing export const removedPath = ( paths, target ) =&gt; { return paths.filter( path =&gt; path !== target); }; import {"
url: "https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/65ccbc9443da7222f04c3a90"
---

[Discussion](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2)

Comment [How to do freehand tracing with React Native?](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2)

[Hsiangyu Hu](https://hashnode.com/@hsiang)

[Feb 14, 2024](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/65ccbc9443da7222f04c3a90)

Here's an example of how you could do diffing

```
export const removedPath = (paths, target) => {
  return paths.filter(path => path !== target);
};
```

```
import {removedPath} from './index';

const targetOne = [
  [1, 1],
  [1, 2],
  [1, 3],
  [1, 4],
];

const targetTwo = [
  [2, 1],
  [2, 2],
  [2, 3],
  [2, 4],
];

const originPath = [targetOne, targetTwo];

describe('removedPath', () => {
  test('should remove targetOne and left targetTwo', () => {
    const result = removedPath(originPath, targetOne);
    expect(result).toEqual([targetTwo]);
  });

  test('should remove nothing', () => {
    const result = removedPath([targetTwo], targetOne);
    expect(result).toEqual([targetTwo]);
  });
});
```
