Konva
is a javascript framework that allows you to draw into the canvas in an object-oriented way. Overview: https://konvajs.github.io/docs/
You can think about it as "DOM (document object models) for the canvas". So you don't draw into canvas manually. You just change shapes.
That object model is NOT DOM of the browser (like document.body
, divs
and other elements). It is just plain javascript objects.
So react
is for managing DOM (all elements) of your application. So I thought it will be a good idea to manage Konva shapes from react too (as it is too similar to DOM mindset). So I created react-konva
https://konvajs.github.io/docs/react/.
react-konva
is a bridge between react
and konva
.
So when you do
<Layer>
<Circle />
</Layer>
it will not create DOM elements, it will create Konva
nodes instead. From that nodes Konva
will make a drawing.