Software Engineer
Building Great Apps with React Native
Markdown supported · ⌘↵ to post
what you doing inside the diff function? How do you finding that the trace line is inside or outside ?
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.
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".
Hsiangyu Hu
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]); }); });