react-live-drawing-firebase

drawinig canvas save it to firebase

Usage no npm install needed!

<script type="module">
  import reactLiveDrawingFirebase from 'https://cdn.skypack.dev/react-live-drawing-firebase';
</script>

README

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();