Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@thalesness/react-native-canvas-scratch-card

thalesgaldino50MIT0.0.6TypeScript support: included

react-native-canvas-scratch-card allows you to scratch to reveal the image background

react-native, react-native-sketch, react-native-svg, react, native, sketch, svg, draw, scratchcard

readme

react-native-canvas-scratch-card

A React Native component for scratch card on Android.

Installation


Install from npm (only support RN >= 0.40)

npm install @thalesness/react-native-canvas-scratch-card --save

Link native code

react-native link @thalesness/react-native-canvas-scratch-card

Usage

import React, { Component } from "react";
import { AppRegistry, View } from "react-native";

import { ScratchCard } from "@thalesness/react-native-canvas-scratch-card";

export default class example extends Component {
  render() {
    return <ScratchCard strokeWidth={40} fillColor={"#FF0000"} bgImage={{
         filename:bulb.png”,
         directory: “”
       }} />;
  }
}

AppRegistry.registerComponent("example", () => example);