将FabricJS与React-Native一起使用

将FabricJS与React-Native一起使用

问题描述:

我有一个基于ReactJS并广泛使用FabricJS的应用程序.我们计划重用大量代码,并使用React-Native构建移动应用程序,但我不确定如何将FabricJS组件集成到其中.

I have an application which is built on a ReactJS and uses FabricJS extensively. We plan to reuse a lot of code and build mobile apps using React-Native but I am not sure how we can integrate the FabricJS component into it.

该应用类似于 https://www.my-wallsticker.de/wandtattoo-selber-gestalten/

我找到并使用了 https://www.npmjs.com/package/react- fabricjs ,但没有可用于React-Native的

I have found and used https://www.npmjs.com/package/react-fabricjs but nothing available for React-Native.

有什么解决方案?

您将不得不在画布上使用WebView(或类似该库的东西:

You would have to use a WebView with canvas (or something like this library: https://github.com/iddan/react-native-canvas) in order to be able to render anything with FabricJS.