Can I migrate from react-konva to react-pixi-fiber? #244
-
Hi, I recently upgraded the react version to 17.0.0 in the application. Previous developers used 'react-konva' but it no longer works with react 17 (even with latest konva and react-konva-rc.1 version suggested in react-konva discussions). Coding in JS style in react solved part of the problem but created issues on mobile part of our application. Need to dynamically create a rectangle (as shown in the above picture with text on mouse click. The issue is we are importing the APIs like Stage, Layer, Group, Rect, Text from react-konva. Though I can adjust Stage with different props in react-pixi-fiber, I'm not sure about the replacement for the "Layer" api of react-konva. Any doubts/suggestions are welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @Siva-at-OFS, in PixiJS you can use layers by installing additional package. There's an example for react-pixi-fiber here: https://github.com/michalochman/react-pixi-fiber/blob/master/examples/src/LayersExample/index.js Note that it uses older version, but you should be able to upgrade with ease. |
Beta Was this translation helpful? Give feedback.
-
Hi @Siva-at-OFS,
|
Beta Was this translation helpful? Give feedback.
Hi @Siva-at-OFS, sorry for long delay.
Regarding the rectangle, in line 60 of
App.js
file you have{...RectProps}
butRectProps
is not exported from constants,rectProps
is. Once you fix it, the rectangle will show.Regarding
Text
styles, there is nobackgroundColor
property, have a look at all properties described here: https://pixijs.download/release/docs/PIXI.TextStyle.html.