Installation


This library operates on react-native>=0.60.

npm install react-native-reanimated react-native-gesture-handler react-native-reanimated-canvas --save
//  OR
yarn add react-native-reanimated react-native-reanimated react-native-reanimated-canvas

//  For iOS
cd ios && pod install

@next

Install the next build.

yarn add react-native-reanimated-canvas@next

Usage

import React, { Component } from 'react';
import RCanvas, { RCanvasProps, RPath } from 'react-native-reanimated-canvas';

export default function Canvas(props: RCanvasProps) {
  return (
    <RCanvas
      style={{ flex: 1 }}
      strokeColor='red'
      strokeWidth={7}
    >
      <RPath
        points={new Array(200).fill(0).map((v, i) => ({ x: i, y: i }))}
        strokeWidth={20}
        strokeColor='pink'
      />
    </RCanvas>
  );
}