How to implement free drawing canvas with react?

The demo shows how to implement free drawing app is “react-way” with full vector representation.

Such implementation should work ok for many whiteboard apps. It will allows you to simply add undo/redo functions and save full state into backend.

But it will start work slowly if you have too many lines in the state. So you will have to do some extra optimizations if you want to enable drawings of hundreds or thousands of lines.