I really want to make use of the pencil kit in my react-native application. I just want to know whether I can do it. If yes, then how?
2 Answers
TLDR: Doesn't exist as of 2/6/2021 and you will need to write bridge code between react native (js) and native (swift/ObjC). There are big performance limitations with this approach. I recommend you create a native Swift based app for your project.
I was also curious if this is available.
For those willing to use Swift, here's the sample shown during the demo.
For those that want to use PencilKit / CoreML native libraries from React native you need need to write bridge code between Javascript (please use typescript) and the native code.
Here's more information on bridging and a guide.
For me, I will be building a note taking app and it needs to be performant. Despite being a react / react native developer I will be choosing Swift to build this project due to performance concerns.
Last point to make is that you can use react native and native together. But this is more of a headache than an enabler. AirBnB used this for some time but moved away from this approach.
For anyone new to React Native, it's a great platform. I personally like to use it for simple applications (not graphically intensive). You can also use it with the Expo tooling which speeds up prototyping but be warned some functionalities are not available bluetooth is one example.

- 2,834
- 2
- 24
- 25
Yes I Did it. I created a native view for iOS Pencil Kit in React Native with Swift. You can check basic examples for native module in my Repo

- 3,947
- 1
- 26
- 37
-
Can you share example of pencilkit with react-native? How can I use apple pencil in react-native app. – Ravina Vaishnav Aug 04 '22 at 09:34