Render DOM elements inside canvas stage

获取Konva最新的信息

How to draw DOM elements (like inputs or divs) inside of Konva stage?

Currently react-konva doesn’t support React.createPortal API. If you want to have some DOM nodes as part of your canvas tree you can create your own custom Portal component that will draw DOM nodes outside of Konva.Stage.

DOM nodes may still looks like a part of canvas if you place them on top of canvas element with absolute position.

Be careful here. In current demo components in the portal have to access to React contexts. If you need to use them, you need to pass them directly.

Next