Is it possible to get native layout as an object in React Native native module

62 Views Asked by At

It's hard to phrase the question, so I'll explain what I'm trying to do.

I'm creating React Native app (ideally Expo) that will use my custom created native module. This native module will use an SDK (native android/iOS) to display screens on custom display device. This SDK uses its own classes for the screens instead of Android/iOS views. But this custom class is kind of a wrapper around normal views.

What I'm trying to determine if possible is following:

  1. In Expo app define the layout of screen for custom display device (probably just a react native component)
  2. Using native module call some method like displayOnDevice(myReactNativeComponent)
  3. In native code myReactNativeComponent should be somehow converted to native view
  4. I can attach this view to SDK custom class for displaying

Point 3 is crucial here. I'm checking source code of expo and react-native and so far I don't see if this conversion/rendering of a view can be triggered manually.

In general my question boils down to: is it possible to get converted native view in Expo native module, while sending a Component from Expo side.

Also showing of this view should be done programmatically (like after pressing a button), not tied to routes etc. It should be independent from Expo app's screens and routes.

0

There are 0 best solutions below