Creating plugins for native applications - component code not updating?

Hi forums,

Adding &mobile_plugins=true to the end of the plugin editor URL lets you create a mobile element. There’s a code block that allows you to return a React native component - great.

However, I’ve run into a problem and I’m not sure if it’s because I don’t have access proper access to the plugin alpha or perhaps this is just a bug. When updating the component code with some basic Hello World JSX:

function component(props) {
  return <Text>Hello!</Text>;
}

Nothing appears on the page. When inspecting the code in the debugger (I also tried adding a debugger breakpoint as well to test this):

function anonymous(React
) {
  return function component(props) {
    //# sourceURL=PLUGIN_1750677535432x6411154733379092 [ ... ]
  }
}

The component code is … empty :thinking:

Is anyone else seeing this?

Thank you for your time,

Jonah


Hello, this is what I can see.

I did the same, and I can see this while debugging it.

Does this happen in your console and page when you do that?

(the whole preview breaks, and I get several errors)

Yes, it happens I think we should import Text element from react naitve

1 Like

function(props) {

const React = props.context.libraries['react'];
const {
    View,
    Text,
    ScrollView,
    Image,
    TouchableOpacity,
    Dimensions,
    Animated,
    Platform
} = props.context.libraries['react-native'];


return <Text>Hello </Text>

}

Please use this code.

I got it to work:

My error was that I was writing the function component (props) {} and not function (props) {}

Note: I find it concerning that if you write something that throws an error, the entire application refuses to load. If that’s the case, using third party libraries should be considered really dangerous to use

Thanks for your help @univgalaxy1112 :slight_smile:

Yea, and I think Text from react-native should be imported in your component.

How long have this featuer been live in bubble?

I’m not sure. Someone tipped me off that using &mobile_plugins=true activates the editor, that’s all I know.

I just saw this feature just after you posted it. btw, this is a great addition. good work bubble team.

This will attract a lot of react native developers, and we won’t need any 3rd party native app builders like BDK.

@jonah.deleseleuc are you building something? let’s build it together

1 Like

Sure! send me an email: jonah@floop.app

Sent you an email