---
title: "Discussion on \"How to do freehand tracing with React Native?\" | Hashnode"
description: "Discussion on \"How to do freehand tracing with React Native?\". Background\nRecently I came across a LinkedIn post asking about freehand tracing with React Native. \n\nIt caught my interest and I was thinking about how would I accomplish it if it was me. \nAnd this is where the journey begins.\nInitial Thoughts\nThe fi..."
url: "https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to do freehand tracing with React Native?](https://hsiang.dev/how-to-do-freehand-tracing-with-react-native?utm_source=hashnode&utm_medium=feed)

Background Recently I came across a LinkedIn post asking about freehand tracing with React Native. It caught my interest and I was thinking about how would I accomplish it if it was me. And this is where the journey begins. Initial Thoughts The fi...

Aug 29, 2022 · 6 min read · hsiang.dev  
Read the article

-   [#react-native](https://hashnode.com/tag/react-native)

## Written by

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

@hsiang · UK

  
[View profile](https://hashnode.com/@hsiang)

Software Engineer

Building Great Apps with React Native

## Responses 9

Markdown supported · ⌘↵ to post

[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]);
  });
});
```

[prashant shukla](https://hashnode.com/@prashantshukla)

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

Can you please consolidate all the codes and put together, which will help.

[prashant shukla](https://hashnode.com/@prashantshukla)

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

what you doing inside the diff function? How do you finding that the trace line is inside or outside ?

[Laurence Troy Sambaan Valdez](https://hashnode.com/@laurencetroyv)

[Dec 20, 2023](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/6583182513bee953f6486ffb)

I appreciate your insightful blog post on freehand tracing with React Native. I am curious about the implementation details, but I understand that the source code is not publicly available. Thank you for sharing your knowledge and experience.

[Jimuel Baraero](https://hashnode.com/@wegojimmm)

[Dec 18, 2023](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/657fa498c6ef1959c343270d)

what the diff function means? please answer

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

[Aug 8, 2023](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/64d2b04a32895e0c90ef6be4)

Unfortunately the source code wasn't intend to open source.

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

[Aug 8, 2023](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/64d2af8ec1b3ce0c7e9343ff)

Hey Amit,

I guess the issue is around react-native-fs while getting the image path ?

[Amit chaudhary](https://hashnode.com/@amitvchaudhary)

[Aug 7, 2023](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/64d0c8a36644e2f8eb7f92ec)

Where can I find the code?

[Amit chaudhary](https://hashnode.com/@amitvchaudhary)

[Aug 6, 2023](https://hashnode.com/posts/how-to-do-freehand-tracing-with-react-native/630c91c443d7308e3e3264e2/comment/64cf8f4b3d3aabc9723fa8db)

Thank you very much for spending time on this topic. I would like your help. Wanted to know if you encountered any error related to "could not parse path from string".
