react-live-drawing-firebase

1.1.8 • Public • Published

Canvas Drawing to firebase

Based on https://github.com/embiem/react-canvas-draw

Installation

npm install --save react-live-drawing-firebase

Usage

Person drawing:

import { ReactLiveDrawing } from "react-live-drawing-firebase";

<ReactLiveDrawing
  ref={(canvasDraw) => (drawingRef = canvasDraw)}
  db={fire.database().ref("draw-room")}
  {...props}
/>;

Person viewing

Live view

import {LiveViewer} from 'react-live-drawing-firebase'
<LiveViewer db={fireBase.ref('draws') {...props}} />

Recorder view

import { RecorderViewer } from "react-live-drawing-firebase";
<RecorderViewer db={firebase.href("draw")} {...props} />;

props

Functions

functions are only available on ReactLiveDrawing

clear

This function will clear the canvas, delete lines from firebase and will cause an update on the viewer

canvasDraw.clear();

Readme

Keywords

none

Package Sidebar

Install

npm i react-live-drawing-firebase

Weekly Downloads

1

Version

1.1.8

License

ISC

Unpacked Size

9.23 kB

Total Files

4

Last publish

Collaborators

  • antonio_pacheco