- and one wrapper component called Paper which serves as a canvas on which these primitives are drawn.
- Here is a basic example – – – You can also render the primitives when working with ReactDOM as this just renders to a canvas node.
- ( )) create function has already rendered the canvas node.
- So now you can continue to use React with ReactDOM as you used to.
- Make changes directly to the
component.
react-handy-renderer – ✏️ Draw 2D primitives in sketchy style with React
@NTulswani: ✏️ Draw 2D primitives in sketchy style with React #reactjs
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
import React from ‘react’; import { render, Paper, Ellipse } from ‘react-handy-renderer’; function Sketch() { return (
< /Paper> ); } render( , document.getElementById(‘canvas-container’));
import React, { Component } from ‘react’ import { render as create, Paper, Rectangle, Main, Ellipse, Line, RoundedRect, Curve, } from ‘react-handy-renderer’ function Sketch() { return (
< /Paper> ) } // Renders the canvas node create( , document.getElementById(‘root’)) // create function has already rendered the canvas node….