brillout / react-streaming

React Streaming. Full-fledged & Easy.
MIT License
216 stars 14 forks source link

Support React Native (or expo)? #30

Closed pencilcheck closed 9 months ago

pencilcheck commented 9 months ago

I took your code and made it semi working on RN but I have to replace a couple things such as

  1. remove useId() and just pass stringify key two times into the useSuspense
  2. change useSuspenseData from ts to tsx so I can create provider wrap manually to the _layout of expo app
  3. removed the provideInitialData bit as there is no html in RN/Expo

It works with Suspense! However removing useId makes me unease, I wonder if there is a better workaround but in the mean time do you think you can use this knowledge to add support for expo officially?

Thanks.

brillout commented 9 months ago

In the long term, I agree, it would be really nice to directly support RN as well. But for now I think the best would be a fork. Let me know if you publish a fork and I'll add a link to it in the readme.