Installing Declarativas in Your Application
Installing
With npm or yarn
$ npm install --save declarativas
# OR
$ yarn add declarativasimport { render, createElement as c, ClearCanvas, Properties, StrokeRect } from 'declarativas';
// Get your canvas from an HTML file.
const canvas = document.querySelector('canvas');
render(
[
c(ClearCanvas),
c(Properties, { strokeStyle: 'black' }),
c(StrokeRect, {
x: 100,
y: 100,
w: 20,
h: 20,
})
]),
canvas.getContext('2d'),
);With a CDN
Last updated