Skip to content

Want to know if linking url to any react-konva layer like Rect/Text can be done? #1493

Answered by lavrton
ahmadrazach asked this question in Q&A
Discussion options

You must be logged in to vote

There is no such thing as "link" in react-konva. It is just a canvas element where you draw.
But what you can do is:

  1. Listen to click event on any node (stage, layer, group, shape)
  2. On click, manually open url on new tab
<Rect
  {...props}
  onClick={() => {
    window.open(url, '_blank');
  }}
/>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ahmadrazach
Comment options

Answer selected by ahmadrazach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants