feTS icon indicating copy to clipboard operation
feTS copied to clipboard

React Native support

Open Ashraf-Ali-aa opened this issue 4 months ago • 3 comments

Is your feature request related to a problem? Please describe.

I have been trying to use the library in a Expo React native app but the app is crashing due to missing EventType and undefined type, I am presuming there are packages that are not supported in react native /Hermes. I was wondering if there were plans on supporting react native or any pointers that I can use to see if I can add support.

Ashraf-Ali-aa avatar Aug 30 '25 22:08 Ashraf-Ali-aa

feTS is platform agnostic and it uses Fetch API. It doesn't use any Node specific code. Runtime-wise i don't think anything should be missing for React Native. Typing issues might be related to your setup/configuration. If you share a reproduction, we can help you better. Thanks!

ardatan avatar Aug 31 '25 09:08 ardatan

@ardatan, I have created a sample Expo React Native project that shows the issue I am facing. I do have Jest tests running, and I don't encounter any problems. However, when I try to use the client within the app, the app fails to load. I think I'll need to add shims for react native/Hermes, but I have been unsuccessful in getting them to work. Thanks again for a brilliant library

https://github.com/Ashraf-Ali-aa/my-app

Image

Ashraf-Ali-aa avatar Aug 31 '25 13:08 Ashraf-Ali-aa

@ardatan I have managed to get Fets working on react native by modifying the Metro bundler. The main issue was with typebox

https://github.com/Ashraf-Ali-aa/my-app/blob/main/metro.config.js

Ashraf-Ali-aa avatar Sep 20 '25 08:09 Ashraf-Ali-aa