Replies: 1 comment
-
Thanks for opening the discussion @lindboe, I was facing the same problem of extending an existing component. Before codegen and the new architecture, our app was using an extension of react-native-webview. Their official guides for iOS and Android are outdated now though. The problems I encountered were similar to the ones stated above:
It was a while ago that I tried this and I'd have to dig up my notes, but those were the most prominent blockers I ran into. Same as @lindboe mentioned above. My gut feeling is that replicating the different ways one can declare and extend types and interfaces in Typescript will be hard to mirror in codegen results. Maybe being more restrictive (i.e. by using a subset of Typescript) for the definitions could make things simpler. Looking forward to the discussion evolving! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been working on extending react-native-webview so I can integrate another library, and I tried by copying and modifying its codegen spec, and making a new component that subclasses the original classes where relevant. This worked pretty well for Android, but I'm running into issues with iOS.
I want to subclass
RNCWebView
, but the props forMyWebView
are a totally different unrelated type now with additional fields that changes the memory layout, and so I can't easily haveMyWebView
subclassRNCWebView
and then pass the props toRNCWebView
'supdateProps
, it gives EXC_BAD_ACCESS errors.I'm looking into a couple different options to work around this:
I'm curious if anyone else has insight or advice here. I will also be adding custom events later if it affects the advice.
Beta Was this translation helpful? Give feedback.
All reactions